Skip to content

Commit

Permalink
fix: update TaskExecution status field to have a default value of "ru… (
Browse files Browse the repository at this point in the history
  • Loading branch information
jhonylucas74 authored Jul 23, 2024
1 parent 180f579 commit cda6ba4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions backend/apps/core/migrations/0004_alter_taskexecution_status.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
2 changes: 1 addition & 1 deletion backend/apps/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion backend/apps/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit cda6ba4

Please sign in to comment.