fix(backup): trim auto-snapshots on setting the quotas
continuous-integration/drone/push Build is failing Details

pull/56/head
Houkime 2023-09-08 16:22:53 +00:00
parent ad9384c850
commit 56be3d9c31
2 changed files with 6 additions and 1 deletions

View File

@ -396,6 +396,9 @@ class Backups:
)
)
for service in get_all_services():
Backups._prune_auto_snaps(service)
# Restoring
@staticmethod

View File

@ -520,8 +520,10 @@ def test_too_many_auto(backups, dummy_service):
# Retroactivity
quota.total = 1
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)
assert len(snaps) == 1
assert snap5 in snaps