bundles/backup-server: fix stupid in check_backup_for_node
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit

This commit is contained in:
Franzi 2022-02-28 21:09:04 +01:00
parent e909144544
commit 931d566736
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -10,7 +10,7 @@ NODE = argv[1]
ONE_BACKUP_EVERY_HOURS = int(argv[2])
NOW = int(time())
DAY_SECONDS = 60 * 60 * 24
HOUR_SECONDS = 60 * 60
snaps = set()
@ -46,9 +46,9 @@ try:
# One day without backups is still okay. There may be fluctuations
# because of transfer speed, amount of data, changes in backup
# schedule etc.
if delta > (DAY_SECONDS * (ONE_BACKUP_EVERY_HOURS + 2)):
if delta > ((HOUR_SECONDS * (ONE_BACKUP_EVERY_HOURS + 1)) + (HOUR_SECONDS*24)):
exit(2)
elif delta > (DAY_SECONDS * (ONE_BACKUP_EVERY_HOURS + 1)):
elif delta > (HOUR_SECONDS * (ONE_BACKUP_EVERY_HOURS + 1)):
exit(1)
else:
exit(0)