Fix schedule restores

This commit is contained in:
Andrew 2023-01-16 11:20:15 -05:00
parent d7d27b00c4
commit 944d01ab19
2 changed files with 11 additions and 10 deletions

View File

@ -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

View File

@ -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(