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

[#2835] Remove legacy celery tasks #1461

Merged
merged 1 commit into from
Oct 29, 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
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
Loading