feat: show scheduler status on RQ job page
This commit is contained in:
parent
6d264b149a
commit
46df97c3f2
2 changed files with 15 additions and 0 deletions
|
|
@ -14,5 +14,13 @@ frappe.listview_settings["RQ Job"] = {
|
|||
listview.list_view_settings.disable_count = 1;
|
||||
listview.list_view_settings.disable_sidebar_stats = 1;
|
||||
}
|
||||
|
||||
frappe.xcall("frappe.utils.scheduler.get_scheduler_status").then(({ status }) => {
|
||||
if (status === "active") {
|
||||
listview.page.set_indicator(__("Scheduler: Active"), "green");
|
||||
} else {
|
||||
listview.page.set_indicator(__("Scheduler: Inactive"), "red");
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -177,3 +177,10 @@ def activate_scheduler():
|
|||
enable_scheduler()
|
||||
if frappe.conf.pause_scheduler:
|
||||
update_site_config("pause_scheduler", 0)
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_scheduler_status():
|
||||
if is_scheduler_inactive():
|
||||
return {"status": "inactive"}
|
||||
return {"status": "active"}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue