コード例 #1
0
ファイル: scheduler.py プロジェクト: yangfenxiangyocom/frappe
def trigger(site, event, now=False):
	"""trigger method in startup.schedule_handler"""
	from frappe.tasks import scheduler_task

	for handler in frappe.get_hooks("scheduler_events").get(event, []):
		if not check_lock(handler):
			if not now:
				scheduler_task.delay(site=site, event=event, handler=handler)
			else:
				scheduler_task(site=site, event=event, handler=handler, now=True)
コード例 #2
0
ファイル: scheduler.py プロジェクト: omirajkar/saloon_frappe
def trigger(site, event, now=True):
    """trigger method in startup.schedule_handler"""
    from frappe.tasks import scheduler_task

    for handler in frappe.get_hooks("scheduler_events").get(event, []):
        # if not check_lock(handler):
        # 	if not now:
        # 		print "not now -----------------------------"
        # 		scheduler_task.delay(site=site, event=event, handler=handler)
        # 	else:
        print "running now -----------------------------"
        scheduler_task(site=site, event=event, handler=handler, now=True)

    if frappe.flags.in_test:
        frappe.flags.ran_schedulers.append(event)
コード例 #3
0
def trigger(site, event, now=True):
	"""trigger method in startup.schedule_handler"""
	from frappe.tasks import scheduler_task

	for handler in frappe.get_hooks("scheduler_events").get(event, []):
		# if not check_lock(handler):
		# 	if not now:
		# 		print "not now -----------------------------"
		# 		scheduler_task.delay(site=site, event=event, handler=handler)
		# 	else:
		print "running now -----------------------------"
		scheduler_task(site=site, event=event, handler=handler, now=True)

	if frappe.flags.in_test:
		frappe.flags.ran_schedulers.append(event)