def sync_shopify(): "Enqueue longjob for syncing shopify" from frappe.tasks import scheduler_task scheduler_task.delay(site=frappe.local.site, event="hourly_long", handler="erpnext_shopify.api.sync_shopify_resources") frappe.msgprint(_("Queued for syncing. It may take a few minutes to an hour if this is your first sync."))
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)
def sync_shopify(): "Enqueue longjob for syncing shopify" from frappe.tasks import scheduler_task scheduler_task.delay(site=frappe.local.site, event="hourly_long", handler="erpnext_shopify.api.sync_shopify_resources") frappe.msgprint( _("Queued for syncing. It may take a few minutes to an hour if this is your first sync." ))