mirror of
https://github.com/ep1cman/unifi-protect-backup.git
synced 2025-12-05 23:53:30 +00:00
Added a retry delay
This commit is contained in:
@@ -340,8 +340,9 @@ class UnifiProtectBackup:
|
||||
assert isinstance(video, bytes)
|
||||
break
|
||||
except AssertionError as e:
|
||||
logger.warn(" Failed download attempt {x+1}")
|
||||
logger.warn(" Failed download attempt {x+1}, retying in 1s")
|
||||
logger.exception(e)
|
||||
await asyncio.sleep(1)
|
||||
else:
|
||||
logger.warn(f"Download failed after 5 attempts, abandoning event {event.id}:")
|
||||
continue
|
||||
@@ -351,8 +352,9 @@ class UnifiProtectBackup:
|
||||
await self._upload_video(video, destination)
|
||||
break
|
||||
except RcloneException as e:
|
||||
logger.warn(" Failed upload attempt {x+1}")
|
||||
logger.warn(" Failed upload attempt {x+1}, retying in 1s")
|
||||
logger.exception(e)
|
||||
await asyncio.sleep(1)
|
||||
else:
|
||||
logger.warn(f"Upload failed after 5 attempts, abandoning event {event.id}:")
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user