mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-04 18:53:10 +00:00
fix(backup): trim auto-snapshots on setting the quotas
This commit is contained in:
parent
ad9384c850
commit
56be3d9c31
|
@ -396,6 +396,9 @@ class Backups:
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
for service in get_all_services():
|
||||||
|
Backups._prune_auto_snaps(service)
|
||||||
|
|
||||||
# Restoring
|
# Restoring
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -520,8 +520,10 @@ def test_too_many_auto(backups, dummy_service):
|
||||||
# Retroactivity
|
# Retroactivity
|
||||||
quota.total = 1
|
quota.total = 1
|
||||||
Backups.set_autobackup_quotas(quota)
|
Backups.set_autobackup_quotas(quota)
|
||||||
snap5 = Backups.back_up(dummy_service, BackupReason.AUTO)
|
snaps = Backups.get_snapshots(dummy_service)
|
||||||
|
assert len(snaps) == 1
|
||||||
|
|
||||||
|
snap5 = Backups.back_up(dummy_service, BackupReason.AUTO)
|
||||||
snaps = Backups.get_snapshots(dummy_service)
|
snaps = Backups.get_snapshots(dummy_service)
|
||||||
assert len(snaps) == 1
|
assert len(snaps) == 1
|
||||||
assert snap5 in snaps
|
assert snap5 in snaps
|
||||||
|
|
Loading…
Reference in a new issue