def doctor(site=None):
 with frappe.init_site(site):
  workers_online = check_number_of_workers()
  (jobs_per_queue, job_count) = get_jobs_by_queue(site)
 print u'-----Checking scheduler status-----'
 if site:
  sites = [site]
 else:
  sites = frappe.utils.get_sites()
 for s in sites:
  frappe.init(s)
  frappe.connect()
  if is_scheduler_disabled():
   print u'Scheduler disabled for', s
  frappe.destroy()
 print u'Workers online:', workers_online
 print u'-----{0} Jobs-----'.format(site)
 for queue in get_queue_list():
  if jobs_per_queue[queue]:
   print u'Queue:', queue
   print u'Number of Jobs: ', job_count[queue]
   print u'Methods:'
   for (method, count) in jobs_per_queue[queue].iteritems():
    print u'{0} : {1}'.format(method, count)
   print u'------------'
 return True

def doctor ( site = None ) : with frappe . init_site ( site ) : workers_online = check_number_of_workers ( ) ( jobs_per_queue , job_count ) = get_jobs_by_queue ( site ) print u'-----Checking scheduler status-----' if site : sites = [ site ] else : sites = frappe . utils . get_sites ( ) for s in sites : frappe . init ( s ) frappe . connect ( ) if is_scheduler_disabled ( ) : print u'Scheduler disabled for' , s frappe . destroy ( ) print u'Workers online:' , workers_online print u'-----{0} Jobs-----' . format ( site ) for queue in get_queue_list ( ) : if jobs_per_queue [ queue ] : print u'Queue:' , queue print u'Number of Jobs: ' , job_count [ queue ] print u'Methods:' for ( method , count ) in jobs_per_queue [ queue ] . iteritems ( ) : print u'{0} : {1}' . format ( method , count ) print u'------------' return True
prints diagnostic information for the scheduler .