Skip to content

Commit

Permalink
chore: fail to base backup if none exists (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuziontech authored Sep 13, 2023
1 parent a99db4a commit 9bbf187
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions housewatch/clickhouse/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ def run_backup(backup_id, incremental=False):
base_backup = None
S3_LOCATION = f"https://{backup.bucket}.s3.amazonaws.com/{path}"
if incremental:
if not backup.last_run:
logger.info("Cannot run incremental backup without a base backup")
base_backup = backup.last_base_backup
if not backup.last_run or not backup.last_base_backup:
logger.info("Cannot run incremental backup without a base backup, running base backup")
incremental = False
else:
base_backup = backup.last_base_backup
if backup.is_database_backup():
create_database_backup(
backup.database,
Expand Down

0 comments on commit 9bbf187

Please sign in to comment.