-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Celery tasks with English names are duplicates of tasks with Dutch names and are therefore deleted
- Loading branch information
Showing
5 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class MigrationsConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "custom_migrations" |
32 changes: 32 additions & 0 deletions
32
src/custom_migrations/migrations/0001_delete_old_celery_tasks.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Generated by Django 4.2.16 on 2024-10-23 08:26 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def delete_old_celery_tasks(apps, _): | ||
PeriodicTask = apps.get_model("django_celery_beat", "PeriodicTask") | ||
|
||
legacy_tasks = PeriodicTask.objects.filter( | ||
name__in=[ | ||
"Send emails about messages", | ||
"Send emails about expiring plans", | ||
"Send emails about expiring actions", | ||
"Delete old emails", | ||
"Retry emails", | ||
"Rebuild search index", | ||
"Import ZGW data", | ||
] | ||
) | ||
legacy_tasks.delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [("django_celery_beat", "0018_improve_crontab_helptext")] | ||
|
||
operations = [ | ||
migrations.RunPython( | ||
code=delete_old_celery_tasks, | ||
reverse_code=migrations.RunPython.noop, | ||
) | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters