File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 9090 print ("Starting janitor daemon - Ctrl-C to quit" )
9191 logger .info ("(%s) Starting Janitor daemon" % main_pid )
9292
93+ last_failed = False
9394 logger .debug ("(%s) Starting main loop" % main_pid )
9495 print ("%s: Start main loop" % os .getpid ())
9596 while not check_stop ():
9697 try :
9798 now = time .time ()
98- if handle_janitor_tasks (configuration , now ) <= 0 :
99+ if last_failed :
100+ # Throttle on general exception in main loop
101+ interruptible_sleep (configuration , LONG_THROTTLE_SECS ,
102+ (check_run , check_stop ))
103+ last_failed = False
104+ elif handle_janitor_tasks (configuration , now ) <= 0 :
99105 interruptible_sleep (configuration , LONG_THROTTLE_SECS ,
100106 (check_run , check_stop ))
101107 else :
108114 # so we make sure to propagate to monitor child
109115 print ("Interrupt requested - shutdown" )
110116 except Exception as exc :
117+ last_failed = True
111118 logger .error (
112119 "(%s) Caught unexpected exception: %s" % (os .getpid (), exc )
113120 )
You can’t perform that action at this time.
0 commit comments