Skip to content

Commit

Permalink
[#2835] Remove legacy celery tasks
Browse files Browse the repository at this point in the history
    - Celery tasks with English names are duplicates of tasks with
      Dutch names and are therefore deleted
  • Loading branch information
pi-sigma committed Oct 28, 2024
1 parent a6bb96b commit 2eaf8b5
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 0 deletions.
Empty file.
6 changes: 6 additions & 0 deletions src/custom_migrations/apps.py
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 src/custom_migrations/migrations/0001_delete_old_celery_tasks.py
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.
1 change: 1 addition & 0 deletions src/open_inwoner/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
"django_setup_configuration",
"django_yubin",
"notifications",
"custom_migrations",
# Project applications.
"open_inwoner.components",
"open_inwoner.kvk",
Expand Down

0 comments on commit 2eaf8b5

Please sign in to comment.