def start_scheduler():
 interval = (frappe.get_conf().scheduler_interval or 240)
 schedule.every(interval).seconds.do(enqueue_events_for_all_sites)
 while True:
  schedule.run_pending()
  time.sleep(1)

def start_scheduler ( ) : interval = ( frappe . get_conf ( ) . scheduler_interval or 240 ) schedule . every ( interval ) . seconds . do ( enqueue_events_for_all_sites ) while True : schedule . run_pending ( ) time . sleep ( 1 )
run enqueue_events_for_all_sites every 2 minutes .