mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix scheduled task disable
This commit is contained in:
parent
2706ffddbe
commit
3681f52856
@ -436,7 +436,15 @@ class TasksManager:
|
|||||||
and "cron_string" in job_data
|
and "cron_string" in job_data
|
||||||
and "interval_type" in job_data
|
and "interval_type" in job_data
|
||||||
):
|
):
|
||||||
return
|
if not "enabled" in job_data:
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
if job_data["enabled"] is True:
|
||||||
|
job_data = HelpersManagement.get_scheduled_task(sch_id)
|
||||||
|
job_data["server_id"] = job_data["server_id"]["server_id"]
|
||||||
|
else:
|
||||||
|
self.scheduler.remove_job(str(sch_id))
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if job_data["interval"] != "reaction":
|
if job_data["interval"] != "reaction":
|
||||||
|
@ -97,7 +97,7 @@ class ApiServersServerTasksTaskIndexHandler(BaseApiHandler):
|
|||||||
if str(data.get("parent")) == str(task_id) and data.get("parent") is not None:
|
if str(data.get("parent")) == str(task_id) and data.get("parent") is not None:
|
||||||
data["parent"] = None
|
data["parent"] = None
|
||||||
|
|
||||||
HelpersManagement.update_scheduled_task(task_id, data)
|
self.tasks_manager.update_job(task_id, data)
|
||||||
|
|
||||||
self.controller.management.add_to_audit_log(
|
self.controller.management.add_to_audit_log(
|
||||||
auth_data[4]["user_id"],
|
auth_data[4]["user_id"],
|
||||||
|
Loading…
Reference in New Issue
Block a user