Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
improve logs slightly,
Browse files Browse the repository at this point in the history
  • Loading branch information
Heavybullets8 committed May 27, 2024
1 parent da3884f commit aa30dbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions functions/backup_restore/database/restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _get_restore_command(self) -> Tuple[str, str]:
"--if-exists",
"--no-owner",
"--no-privileges",
"--single-transaction"
"--disable-triggers"
]
open_mode = 'rb'

Expand Down Expand Up @@ -201,7 +201,7 @@ def _execute_restore_command(self, retries=3, wait=5) -> Dict[str, str]:
return result

# Check for deadlock and retry if detected
if 'deadlock detected' in stderr:
if b'deadlock detected' in stderr:
message = f"Deadlock detected. Retrying {attempt + 1}/{retries}..."
self.logger.warning(message)
result["message"] = f"{result['message']} {message}"
Expand All @@ -211,4 +211,4 @@ def _execute_restore_command(self, retries=3, wait=5) -> Dict[str, str]:

result["message"] = f"{result['message']} Restore failed after retrying."
self.logger.error(result["message"])
return result
return result
1 change: 0 additions & 1 deletion functions/backup_restore/zfs/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ def list_snapshots(self) -> list:
- list: A list of all snapshot names.
"""
snapshots = list(self.cache.snapshots)
self.logger.debug(f"Listing all snapshots: {snapshots}")
return snapshots

@type_check
Expand Down

0 comments on commit aa30dbe

Please sign in to comment.