diff --git a/frappe/core/doctype/system_settings/system_settings.json b/frappe/core/doctype/system_settings/system_settings.json index 35a03e070e..999e5802c8 100644 --- a/frappe/core/doctype/system_settings/system_settings.json +++ b/frappe/core/doctype/system_settings/system_settings.json @@ -78,11 +78,20 @@ "in_list_view": 0, "label": "Enable Scheduled Jobs", "permlevel": 0 + }, + { + "fieldname": "scheduler_last_event", + "fieldtype": "Data", + "hidden": 1, + "label": "Scheduler Last Event", + "permlevel": 0, + "precision": "", + "report_hide": 1 } ], "icon": "icon-cog", "issingle": 1, - "modified": "2015-02-05 05:11:47.880614", + "modified": "2015-05-03 10:35:04.415621", "modified_by": "Administrator", "module": "Core", "name": "System Settings", diff --git a/frappe/patches.txt b/frappe/patches.txt index a0fc68f60d..f66518afe2 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -73,4 +73,5 @@ frappe.patches.v5_0.fix_email_alert frappe.patches.v5_0.fix_null_date_datetime frappe.patches.v5_0.force_sync_website execute:frappe.delete_doc("DocType", "Tag") -execute:frappe.db.sql("delete from `tabProperty Setter` where `property` in ('idx', '_idx')") \ No newline at end of file +execute:frappe.db.sql("delete from `tabProperty Setter` where `property` in ('idx', '_idx')") +frappe.patches.v5_0.move_scheduler_last_event_to_system_settings diff --git a/frappe/patches/v5_0/move_scheduler_last_event_to_system_settings.py b/frappe/patches/v5_0/move_scheduler_last_event_to_system_settings.py new file mode 100644 index 0000000000..749067612b --- /dev/null +++ b/frappe/patches/v5_0/move_scheduler_last_event_to_system_settings.py @@ -0,0 +1,7 @@ +import frappe + +def execute(): + frappe.reload_doctype('System Settings') + last = frappe.db.get_global('scheduler_last_event') + frappe.db.set_value('System Settings', 'System Settings', 'scheduler_last_event', last) + diff --git a/frappe/utils/scheduler.py b/frappe/utils/scheduler.py index 37b2e8a5e4..0af5b97859 100644 --- a/frappe/utils/scheduler.py +++ b/frappe/utils/scheduler.py @@ -28,11 +28,11 @@ def enqueue_events(site): return nowtime = frappe.utils.now_datetime() - last = frappe.db.get_global('scheduler_last_event') + last = frappe.db.get_value('System Settings', 'System Settings', 'scheduler_last_event') # set scheduler last event frappe.db.begin() - frappe.db.set_global('scheduler_last_event', nowtime.strftime(DATETIME_FORMAT)) + frappe.db.set_value('System Settings', 'System Settings', 'scheduler_last_event', nowtime.strftime(DATETIME_FORMAT)) frappe.db.commit() out = []