Commit a78ccce1 authored by Andreas Valder's avatar Andreas Valder
Browse files

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():
if config.get('DEBUG', False):
print("Scheduler: started {} (frequency 1/{}s)".format(func.__name__, delay))
func(*args, **kargs)
except Exception:
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
Supports Markdown
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