feature(backups): a graphql call to invalidate cache

This commit is contained in:
Houkime 2023-06-01 16:12:32 +00:00 committed by Inex Code
parent 7e022e0cfe
commit 891993e4cd
2 changed files with 10 additions and 0 deletions

View file

@ -269,6 +269,10 @@ class Backups:
return snap
@staticmethod
def force_snapshot_reload():
Backups.sync_all_snapshots()
@staticmethod
def sync_all_snapshots():
upstream_snapshots = Backups.provider().backuper.get_snapshots()

View file

@ -90,3 +90,9 @@ class BackupMutations:
restore_snapshot(snap)
return GenericJobMutationReturn()
@strawberry.mutation(permission_classes=[IsAuthenticated])
def force_snapshots_reload(self) -> GenericMutationReturn:
"""Force snapshots reload"""
Backups.force_snapshot_reload()
return GenericMutationReturn()