Commit 3be35a02 authored by kaiyou's avatar kaiyou

Context from configuration has priority over stored fields

parent ccb77521
Pipeline #132 passed with stage
in 49 seconds
......@@ -74,10 +74,11 @@ def check_run(checkid, function, context, args):
""" Celery task that runs a single check
"""
print("Running check {}".format(checkid))
context.update(celery.current_app.scheduler.state[checkid])
context.update(checkid=checkid, function=function)
result = util.resolve(function)(context, **args)
celery.current_app.scheduler.update(checkid, context, result)
stored = celery.current_app.scheduler.state[checkid]
stored.update(context)
stored.update(checkid=checkid, function=function)
result = util.resolve(function)(stored, **args)
celery.current_app.scheduler.update(checkid, stored, result)
@celery.current_app.task
......
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