mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 21:41:27 +00:00
refactor(backups): handle the case when there is no snapshot to sync date with
This commit is contained in:
parent
53c6bc1af7
commit
1a9a381753
|
@ -275,7 +275,13 @@ class Backups:
|
|||
This is a convenience, maybe it is better to write a special comparison
|
||||
function for snapshots
|
||||
"""
|
||||
return Storage.get_cached_snapshot_by_id(snapshot.id)
|
||||
|
||||
snap = Storage.get_cached_snapshot_by_id(snapshot.id)
|
||||
if snap is None:
|
||||
raise ValueError(
|
||||
f"snapshot {snapshot.id} date syncing failed, this should never happen normally"
|
||||
)
|
||||
return snap
|
||||
|
||||
@staticmethod
|
||||
def _auto_snaps(service) -> List[Snapshot]:
|
||||
|
|
Loading…
Reference in a new issue