mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Fix schedule restores
This commit is contained in:
parent
d7d27b00c4
commit
944d01ab19
@ -78,6 +78,10 @@ class ManagementController:
|
||||
command,
|
||||
name,
|
||||
enabled=True,
|
||||
one_time=False,
|
||||
cron_string="* * * * *",
|
||||
parent=None,
|
||||
delay=0,
|
||||
):
|
||||
return HelpersManagement.create_scheduled_task(
|
||||
server_id,
|
||||
@ -87,7 +91,11 @@ class ManagementController:
|
||||
start_time,
|
||||
command,
|
||||
name,
|
||||
enabled,
|
||||
enabled=True,
|
||||
one_time=False,
|
||||
cron_string="* * * * *",
|
||||
parent=None,
|
||||
delay=0,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
|
@ -440,15 +440,8 @@ class AjaxHandler(BaseHandler):
|
||||
for schedule in self.controller.management.get_schedules_by_server(
|
||||
server_id
|
||||
):
|
||||
self.controller.management.create_scheduled_task(
|
||||
new_server_id,
|
||||
schedule.action,
|
||||
schedule.interval,
|
||||
schedule.interval_type,
|
||||
schedule.start_time,
|
||||
schedule.command,
|
||||
schedule.name,
|
||||
schedule.enabled,
|
||||
self.tasks_manager.update_job(
|
||||
schedule.schedule_id, {"server_id": new_server_id}
|
||||
)
|
||||
# preserve execution command
|
||||
new_server_obj = self.controller.servers.get_server_obj(
|
||||
|
Loading…
x
Reference in New Issue
Block a user