mirror of
https://github.com/narrrl/holy-flavor-rater.git
synced 2026-11-03 16:41:27 +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
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 6.0.2 on 2026-02-19 17:22
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('api', '0028_job_systemconfig'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='job',
|
||||
name='name',
|
||||
field=models.CharField(choices=[('sync_flavors', 'Sync Holy Flavors'), ('cleanup_duplicates', 'Cleanup Duplicate Flavors'), ('backup_db', 'Database Backup'), ('seed_legacy', 'Seed Legacy Data')], max_length=100),
|
||||
),
|
||||
]
|
||||
@@ -241,7 +241,7 @@ class SystemConfig(models.Model):
|
||||
class Job(models.Model):
|
||||
"""Tracks background jobs, their status and scheduling."""
|
||||
JOB_TYPES = [
|
||||
('sync_flavors', 'Sync Shopify Flavors'),
|
||||
('sync_flavors', 'Sync Holy Flavors'),
|
||||
('cleanup_duplicates', 'Cleanup Duplicate Flavors'),
|
||||
('backup_db', 'Database Backup'),
|
||||
('seed_legacy', 'Seed Legacy Data'),
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -14,6 +14,9 @@ services:
|
||||
- ./legacy:/app/legacy
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 1.1.1.1
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.docker.network=narl"
|
||||
@@ -38,6 +41,9 @@ services:
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- internal
|
||||
dns:
|
||||
- 8.8.8.8
|
||||
- 1.1.1.1
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
|
||||
Reference in new issue
Block a user