Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow sharded database backups as well #74

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion housewatch/clickhouse/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def create_table_backup(
)


def create_database_backup(database, bucket, path, aws_key=None, aws_secret=None, base_backup=None, cluster="default"):
def create_database_backup(database, bucket, path, aws_key=None, aws_secret=None, base_backup=None, cluster="default", is_sharded=False):
if aws_key is None or aws_secret is None:
aws_key = settings.AWS_ACCESS_KEY_ID
aws_secret = settings.AWS_SECRET_ACCESS_KEY
Expand All @@ -139,6 +139,7 @@ def create_database_backup(database, bucket, path, aws_key=None, aws_secret=None
aws_key=aws_key,
aws_secret=aws_secret,
base_backup=base_backup,
is_sharded=is_sharded,
)


Expand All @@ -163,6 +164,7 @@ def run_backup(backup_id, incremental=False):
aws_secret=backup.aws_secret_access_key,
cluster=backup.cluster,
base_backup=base_backup,
is_sharded=backup.is_sharded,
)
elif backup.is_table_backup():
create_table_backup(
Expand Down
Loading