def enqueue_events_for_site(site): try: frappe.init(site=site) if frappe.local.conf.maintenance_mode: return frappe.connect(site=site) enqueue_events(site) finally: frappe.destroy()
def test_enqueue_jobs(self): frappe.db.sql("update `tabScheduled Job Type` set last_execution = '2010-01-01 00:00:00'") frappe.flags.execute_job = True enqueue_events(site = frappe.local.site) frappe.flags.execute_job = False self.assertTrue('frappe.email.queue.clear_outbox', frappe.flags.enqueued_jobs) self.assertTrue('frappe.utils.change_log.check_for_update', frappe.flags.enqueued_jobs) self.assertTrue('frappe.email.doctype.auto_email_report.auto_email_report.send_monthly', frappe.flags.enqueued_jobs)
def enqueue_events_for_site(site): try: frappe.init(site=site) if frappe.local.conf.maintenance_mode: return frappe.connect(site=site) enqueue_events(site) except: task_logger.error('Exception in Enqueue Events for Site {0}'.format(site)) raise finally: frappe.destroy()
def enqueue_events_for_site(site): try: frappe.init(site=site) if frappe.local.conf.maintenance_mode: return frappe.connect(site=site) if site not in ['tailorpad.com', 'testfirst']: exec_cmd("../env/bin/frappe --use %s" % (site), cwd="/home/erpnext/admin_site/frappe-bench/sites") enqueue_events(site) finally: frappe.destroy()
def enqueue_events_for_site(site): print dir(enqueue_events_for_site) try: site = "omnitech.gulfcloudservices.com" if site in get_sites(): frappe.init(site=site) if frappe.local.conf.maintenance_mode: return frappe.connect(site=site) enqueue_events(site) except: task_logger.error('Exception in Enqueue Events for Site {0}'.format(site)) raise finally: frappe.destroy()
def enqueue_events_for_site(site): print dir(enqueue_events_for_site) try: site = "omnitech.gulfcloudservices.com" if site in get_sites(): frappe.init(site=site) if frappe.local.conf.maintenance_mode: return frappe.connect(site=site) enqueue_events(site) except: task_logger.error( 'Exception in Enqueue Events for Site {0}'.format(site)) raise finally: frappe.destroy()
def enqueue_events_for_site(site): try: frappe.connect(site=site) enqueue_events(site) finally: frappe.destroy()
def enqueue_scheduler_events(): for site in get_sites(): frappe.connect(site=site) enqueue_events(site) frappe.destroy()