Skip to content

Commit

Permalink
refactor(physical-backup): Send files metadata while restore
Browse files Browse the repository at this point in the history
  • Loading branch information
tanmoysrt committed Jan 23, 2025
1 parent 7a3e839 commit 4905d10
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions press/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,13 +485,17 @@ def physical_backup_database(self, site: Site, site_backup: SiteBackup):

def physical_restore_database(self, site, backup_restoration: PhysicalBackupRestoration):
backup: SiteBackup = frappe.get_doc("Site Backup", backup_restoration.site_backup)
files_metadata = {}
for item in backup.files_metadata:
files_metadata[item.name] = {"size": item.size, "checksum": item.checksum}
data = {

Check warning on line 491 in press/agent.py

View check run for this annotation

Codecov / codecov/patch

press/agent.py#L487-L491

Added lines #L487 - L491 were not covered by tests
"backup_db": backup_restoration.source_database,
"target_db": backup_restoration.destination_database,
"target_db_root_password": get_mariadb_root_password(site),
"private_ip": frappe.get_value(
"Database Server", frappe.db.get_value("Server", site.server, "database_server"), "private_ip"
),
"files_metadata": files_metadata,
"innodb_tables": json.loads(backup.innodb_tables),
"myisam_tables": json.loads(backup.myisam_tables),
"table_schema": backup.table_schema,
Expand Down

0 comments on commit 4905d10

Please sign in to comment.