fix time zone issues

This commit is contained in:
sadnub
2020-11-01 16:26:37 -05:00
parent 9fdbae986c
commit 721ce8f91a

View File

@@ -54,7 +54,9 @@ def create_win_task_schedule(pk, pending_action=False):
task_time_utc = task.run_time_date.replace(tzinfo=agent_tz).astimezone(pytz.utc)
now = djangotime.now()
if task_time_utc < now:
task.run_time_date = now.astimezone(agent_tz) + timedelta(minutes=5)
task.run_time_date = now.astimezone(agent_tz).replace(
tzinfo=None
) + timedelta(minutes=5)
task.save()
r = task.agent.salt_api_cmd(