Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add unique constraint in task_logs for expense_group, add interval for next run #408

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions apps/tasks/migrations/0010_alter_tasklog_expense_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.14 on 2024-11-14 10:37

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('fyle', '0020_expensegroup_export_url'),
('tasks', '0009_error_repetition_count'),
]

operations = [
migrations.AlterField(
model_name='tasklog',
name='expense_group',
field=models.ForeignKey(help_text='Reference to Expense group', null=True, on_delete=django.db.models.deletion.PROTECT, to='fyle.expensegroup', unique=True),
),
]
1 change: 1 addition & 0 deletions apps/tasks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class TaskLog(models.Model):
on_delete=models.PROTECT,
null=True,
help_text="Reference to Expense group",
unique=True
)
payment = models.ForeignKey(
Payment, on_delete=models.PROTECT, help_text="Reference to Payment", null=True
Expand Down
2 changes: 1 addition & 1 deletion apps/workspaces/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def schedule_sync(
defaults={
"schedule_type": Schedule.MINUTES,
"minutes": hours * 60,
"next_run": datetime.now(),
"next_run": datetime.now() + timedelta(hours=hours),
}
)

Expand Down
Loading