Commit a78ccce1 authored by Andreas Valder's avatar Andreas Valder

added debugging output for scheduler

parent 9cc0139b
......@@ -16,11 +16,14 @@ def sched_func(delay, priority=0, firstdelay=None, args=[], kargs={}):
def sched_wrapper():
with app.test_request_context():
try:
if config.get('DEBUG', False):
print("Scheduler: started {} (frequency 1/{}s)".format(func.__name__, delay))
func(*args, **kargs)
except Exception:
traceback.print_exc()
scheduler.enter(delay, priority, sched_wrapper)
scheduler.enter(firstdelay, priority, sched_wrapper)
print("Scheduler: registered {} (frequency 1/{}s, start delay: {}s)".format(func.__name__, delay, firstdelay))
return func
return wrapper
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment