Commit bf27d561 authored by kaiyou's avatar kaiyou

Add the ability to specify multiple instances for a single check

parent 0dbc570e
......@@ -17,13 +17,21 @@ class Scheduler(object):
""" Called by celery upon configuration so we can add beat tasks
for name, check in app.config["checks"].items():
name, check["function"],
check.get("context", {}), check.get("args", {})
instances = check.get("instances", {name: {}})
context = check.get("context", {})
args = check.get("args", {})
for name, instance in instances.items():
instance_context = context.copy()
instance_context.update(instance.get("context", {}))
instance_args = args.copy()
instance_args.update(instance.get("args", {}))
instance.get("schedule", check["schedule"]),
name, instance.get("function", check["function"]),
instance_context, instance_args
def update(self, name, context, status, result):
""" Handle a status update for a given check
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