mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +00:00
feature(backups): a graphql call to invalidate cache
This commit is contained in:
parent
7e022e0cfe
commit
891993e4cd
|
@ -269,6 +269,10 @@ class Backups:
|
||||||
|
|
||||||
return snap
|
return snap
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def force_snapshot_reload():
|
||||||
|
Backups.sync_all_snapshots()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def sync_all_snapshots():
|
def sync_all_snapshots():
|
||||||
upstream_snapshots = Backups.provider().backuper.get_snapshots()
|
upstream_snapshots = Backups.provider().backuper.get_snapshots()
|
||||||
|
|
|
@ -90,3 +90,9 @@ class BackupMutations:
|
||||||
restore_snapshot(snap)
|
restore_snapshot(snap)
|
||||||
|
|
||||||
return GenericJobMutationReturn()
|
return GenericJobMutationReturn()
|
||||||
|
|
||||||
|
@strawberry.mutation(permission_classes=[IsAuthenticated])
|
||||||
|
def force_snapshots_reload(self) -> GenericMutationReturn:
|
||||||
|
"""Force snapshots reload"""
|
||||||
|
Backups.force_snapshot_reload()
|
||||||
|
return GenericMutationReturn()
|
||||||
|
|
Loading…
Reference in a new issue