fix: clear all cache after uninstalling apps (#33513)

This commit is contained in:
Ankush Menat 2025-08-05 12:00:07 +05:30 committed by GitHub
parent 8b02229b52
commit 2bb49d0cf4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -333,6 +333,7 @@ def install_app(name, verbose=False, set_as_patched=True, force=False):
for after_sync in app_hooks.after_sync or []:
frappe.get_attr(after_sync)() #
frappe.clear_cache()
frappe.client_cache.erase_persistent_caches()
frappe.flags.in_install = False
@ -416,6 +417,7 @@ def remove_app(app_name, dry_run=False, yes=False, no_backup=False, force=False)
remove_from_installed_apps(app_name)
frappe.get_single("Installed Applications").update_versions()
frappe.db.commit()
frappe.clear_cache()
for after_uninstall in app_hooks.after_uninstall or []:
frappe.get_attr(after_uninstall)()
@ -428,6 +430,9 @@ def remove_app(app_name, dry_run=False, yes=False, no_backup=False, force=False)
click.secho(f"Uninstalled App {app_name} from Site {site}", fg="green")
frappe.flags.in_uninstall = False
if not dry_run:
frappe.clear_cache()
def _delete_modules(modules: list[str], dry_run: bool) -> list[str]:
"""Delete modules belonging to the app and all related doctypes.