From 3539dacdf025ecc7c65036d8a55b99167380c5fa Mon Sep 17 00:00:00 2001 From: phot0n Date: Mon, 12 Sep 2022 00:38:55 +0530 Subject: [PATCH] fix: commit after app install Since we destroy the connection after app installation, mariadb implicitly rollsback the transaction hence committing upon successfull app installation to prevent data sync loss --- frappe/commands/site.py | 3 +++ frappe/utils/fixtures.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/frappe/commands/site.py b/frappe/commands/site.py index eb5a732f04..13f642ea76 100644 --- a/frappe/commands/site.py +++ b/frappe/commands/site.py @@ -420,6 +420,9 @@ def install_app(context, apps, force=False): print(f"An error occurred while installing {app}{err_msg}") exit_code = 1 + if not exit_code: + frappe.db.commit() + frappe.destroy() sys.exit(exit_code) diff --git a/frappe/utils/fixtures.py b/frappe/utils/fixtures.py index 6b3166bfe6..821b1a1187 100644 --- a/frappe/utils/fixtures.py +++ b/frappe/utils/fixtures.py @@ -25,8 +25,6 @@ def sync_fixtures(app=None): frappe.flags.in_fixtures = False - frappe.db.commit() - def import_custom_scripts(app): """Import custom scripts from `[app]/fixtures/custom_scripts`"""