
from __future__ import unicode_literals
import frappe
from frappe.utils.scheduler import disable_scheduler, enable_scheduler

def execute():
	frappe.reload_doc("core", "doctype", "system_settings")
	if frappe.db.get_global("disable_scheduler"):
		disable_scheduler()
	else:
		enable_scheduler()


from __future__ import unicode_literals
import frappe
from frappe.utils.scheduler import disable_scheduler, enable_scheduler
from frappe.utils import cint

def execute():
	frappe.reload_doc("core", "doctype", "system_settings")
	if cint(frappe.db.get_global("disable_scheduler")):
		disable_scheduler()
	else:
		enable_scheduler()

Fix in enable scheduler patch
Fix in enable scheduler patch

  
  from __future__ import unicode_literals
  import frappe
  from frappe.utils.scheduler import disable_scheduler, enable_scheduler
+ from frappe.utils import cint
  
  def execute():
  	frappe.reload_doc("core", "doctype", "system_settings")
- 	if frappe.db.get_global("disable_scheduler"):
+ 	if cint(frappe.db.get_global("disable_scheduler")):
  		disable_scheduler()
  	else:
  		enable_scheduler()
  
Fix in enable scheduler patch
## Code Before:

from __future__ import unicode_literals
import frappe
from frappe.utils.scheduler import disable_scheduler, enable_scheduler

def execute():
	frappe.reload_doc("core", "doctype", "system_settings")
	if frappe.db.get_global("disable_scheduler"):
		disable_scheduler()
	else:
		enable_scheduler()

## Instruction:
Fix in enable scheduler patch
## Code After:

from __future__ import unicode_literals
import frappe
from frappe.utils.scheduler import disable_scheduler, enable_scheduler
from frappe.utils import cint

def execute():
	frappe.reload_doc("core", "doctype", "system_settings")
	if cint(frappe.db.get_global("disable_scheduler")):
		disable_scheduler()
	else:
		enable_scheduler()
