diff --git a/backend/apps/core/migrations/0004_alter_taskexecution_status.py b/backend/apps/core/migrations/0004_alter_taskexecution_status.py new file mode 100644 index 00000000..8f282b4e --- /dev/null +++ b/backend/apps/core/migrations/0004_alter_taskexecution_status.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Generated by Django 4.2.14 on 2024-07-23 02:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("core", "0003_alter_taskexecution_execution_time"), + ] + + operations = [ + migrations.AlterField( + model_name="taskexecution", + name="status", + field=models.CharField(default="running", max_length=100), + ), + ] diff --git a/backend/apps/core/models.py b/backend/apps/core/models.py index 0a3bc24b..de4acc41 100644 --- a/backend/apps/core/models.py +++ b/backend/apps/core/models.py @@ -20,7 +20,7 @@ class TaskExecution(models.Model): task_name = models.CharField(max_length=255) execution_time = models.DateTimeField(default=datetime.now) duration = models.FloatField(default=0) - status = models.CharField(max_length=255) + status = models.CharField(max_length=100, default="running") result = models.TextField(null=True, blank=True) error = models.TextField(null=True, blank=True) diff --git a/backend/apps/core/tasks.py b/backend/apps/core/tasks.py index b827db4f..387c9024 100644 --- a/backend/apps/core/tasks.py +++ b/backend/apps/core/tasks.py @@ -38,7 +38,7 @@ def get_period(): ) -@db_periodic_task(crontab(minute="0", hour="*/2")) +@db_periodic_task(crontab(day_of_week="monday", hour="3", minute="0")) @not_production_task @log_task_execution("sync_database_with_prod") def sync_database_with_prod():