Commit 9d545a54 authored by Andreas Valder's avatar Andreas Valder
Browse files

schedule no longer stoping on exception

parent ab0b38a8
......@@ -10,6 +10,7 @@ import random
import sched
import traceback
import string
import traceback
app = Flask(__name__)
......@@ -33,7 +34,10 @@ def sched_func(delay, priority=0, firstdelay=None, args=[], kargs={}):
def wrapper(func):
def sched_wrapper():
with app.test_request_context():
func(*args, **kargs)
try:
func(*args, **kargs)
except Exception:
traceback.print_exc()
scheduler.enter(delay, priority, sched_wrapper)
scheduler.enter(firstdelay, priority, sched_wrapper)
return func
......
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