fix: Show site name along with debugging messages

Without the site name, the output doesn't really make sense :')
This commit is contained in:
Gavin D'souza 2022-05-10 13:33:53 +05:30
parent b618d29296
commit d0efa8e3ff

View file

@ -103,11 +103,11 @@ def enqueue_events(site):
def is_scheduler_inactive():
if frappe.local.conf.maintenance_mode:
cprint("Maintenance mode is ON")
cprint(f"{frappe.local.site}: Maintenance mode is ON")
return True
if frappe.local.conf.pause_scheduler:
cprint("frappe.conf.pause_scheduler is SET")
cprint(f"{frappe.local.site}: frappe.conf.pause_scheduler is SET")
return True
if is_scheduler_disabled():
@ -118,14 +118,14 @@ def is_scheduler_inactive():
def is_scheduler_disabled():
if frappe.conf.disable_scheduler:
cprint("frappe.conf.disable_scheduler is SET")
cprint(f"{frappe.local.site}: frappe.conf.disable_scheduler is SET")
return True
scheduler_disabled = not frappe.utils.cint(
frappe.db.get_single_value("System Settings", "enable_scheduler")
)
if scheduler_disabled:
cprint("SystemSettings.enable_scheduler is UNSET")
cprint(f"{frappe.local.site}: SystemSettings.enable_scheduler is UNSET")
return scheduler_disabled