Skip to content

Commit

Permalink
CreateFileAction _BlobFileChanged log message tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Oct 22, 2024
1 parent 9d16725 commit 5a2cdb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prime_backup/action/create_backup_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def bp_rba(h: str) -> Path:
retry_cnt = i + 1 # [1, n]
is_last_attempt = retry_cnt == _BLOB_FILE_CHANGED_RETRY_COUNT
if i > 0:
self.logger.warning('Try to create blob {} (attempt {} / {})'.format(src_path_str, retry_cnt, _BLOB_FILE_CHANGED_RETRY_COUNT))
self.logger.debug('Try to create blob {} (attempt {} / {})'.format(src_path_str, retry_cnt, _BLOB_FILE_CHANGED_RETRY_COUNT))
gen = attempt_once(last_chance=is_last_attempt)
try:
query = gen.send(None)
Expand All @@ -493,8 +493,8 @@ def bp_rba(h: str) -> Path:
self.__blob_by_hash_cache[blob.hash] = blob
return blob, st
except _BlobFileChanged:
next_action = 'no more retry' if is_last_attempt else 'retrying'
self.logger.warning('Blob {} stat has changed, {} (attempt {} / {})'.format(src_path_str, next_action, retry_cnt, _BLOB_FILE_CHANGED_RETRY_COUNT))
next_action = 'No more retry' if is_last_attempt else 'Retrying'
self.logger.warning('Blob {} stat has changed, has someone modified it? {} (attempt {} / {})'.format(src_path_str, next_action, retry_cnt, _BLOB_FILE_CHANGED_RETRY_COUNT))
st = src_path.lstat()
except Exception as e:
self.logger.error('Create blob for file {} failed (attempt {} / {}): {}'.format(src_path_str, e, retry_cnt, _BLOB_FILE_CHANGED_RETRY_COUNT))
Expand Down

0 comments on commit 5a2cdb7

Please sign in to comment.