Skip to content

Commit

Permalink
Merge pull request #1329 from kortschak/nospamlog
Browse files Browse the repository at this point in the history
No need to log an "info" message every 1 second. They are logged as "debug", and a single summary "info" message on loop break.
  • Loading branch information
emtiu authored Oct 8, 2022
2 parents da358a2 + 66ebe7b commit b4dd2d1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions common/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,15 @@ def backup(self, force = False):
'\n' +
gettext.ngettext('Waiting %s second.', 'Waiting %s seconds.', 30) % 30,
30)
for counter in range(30, 0, -1):
logger.info("Cannot start snapshot yet: target directory not accessible. Waiting 1s.")
counter = 0
for counter in range(0, 30):
logger.debug("Cannot start snapshot yet: target directory not accessible. Waiting 1s.")
time.sleep(1)
if self.config.canBackup():
break
if counter != 0:
logger.info("Waited %d seconds for target directory to be available", counter)


if not self.config.canBackup(profile_id):
logger.warning('Can\'t find snapshots folder!', self)
Expand Down

0 comments on commit b4dd2d1

Please sign in to comment.