def run_scheduler(): from webnotes.utils.file_lock import create_lock, delete_lock import webnotes.utils.scheduler if create_lock('scheduler'): webnotes.connect() print webnotes.utils.scheduler.execute() delete_lock('scheduler') webnotes.destroy()
def run_scheduler(site=None): from webnotes.utils.file_lock import create_lock, delete_lock import webnotes.utils.scheduler webnotes.init(site=site) if create_lock('scheduler'): webnotes.connect(site=site) print webnotes.utils.scheduler.execute() delete_lock('scheduler') webnotes.destroy()