mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-04 17:07:01 +01:00
fixed container dns resolution, improved scheduling timezone logic, and renamed sync job
This commit is contained in:
1 parent
31144e4704
commit
2da6c8e240
4 files changed
+33
-2
No files matched your search
@@ -919,7 +919,14 @@ class AdminViewSet(viewsets.ViewSet):
|
||||
|
||||
if next_run is not None:
|
||||
from django.utils.dateparse import parse_datetime
|
||||
job.next_run = parse_datetime(next_run)
|
||||
from django.utils import timezone
|
||||
parsed_dt = parse_datetime(next_run)
|
||||
if parsed_dt:
|
||||
# If it's naive (has no timezone info), assume it's local time
|
||||
if timezone.is_naive(parsed_dt):
|
||||
job.next_run = timezone.make_aware(parsed_dt, timezone.get_current_timezone())
|
||||
else:
|
||||
job.next_run = parsed_dt
|
||||
elif interval is not None and job.interval_hours > 0 and not job.next_run:
|
||||
from django.utils import timezone
|
||||
job.next_run = timezone.now()
|
||||
|
||||
Reference in new issue
Block a user