diff --git a/examples/dev.json b/examples/dev.json index 0d9724f..83c3526 100644 --- a/examples/dev.json +++ b/examples/dev.json @@ -42,7 +42,7 @@ } }, "periods": { - "fast": { "seconds": 15 }, + "fast": { "seconds": 3 }, "medium": { "seconds": 120 }, "slow": { "seconds": 480 } }, @@ -54,14 +54,14 @@ { "class": "etc/dummy", "periods": ["fast"], - "threshold": 1, + "threshold": 10, "args": { "sleep": 1, "fail": true } }, { "class": "etc/dummy", "periods": ["fast"], "threshold": 1, - "args": { "sleep": 10, "fail": false } + "args": { "sleep": 1, "fail": false } } ] }, diff --git a/linspector/core/job.py b/linspector/core/job.py index 2dded36..49ac703 100644 --- a/linspector/core/job.py +++ b/linspector/core/job.py @@ -108,12 +108,15 @@ class Job: if self.job_threshold >= service_threshold: logger.info("Job " + self.hex_string() + ", Threshold reached!") self.status = "ERROR" - self.handle_alarm() + + self.handle_alarm() def handle_alarm(self): for member in self.members: for task in member.get_tasks(): - TaskExecutor.Instance().schedule_task(self.get_message(), task) + if self.status.lower() == task.get_task_type_name(): + logger.debug("Executing Task of type: " + self.status) + TaskExecutor.Instance().schedule_task(self.status + " " + self.get_message(), task) def handle_call(self): logger.debug("handle call")