add task and command

This commit is contained in:
Kenneth Kehl
2025-08-05 13:41:57 -07:00
parent bb68370eae
commit d53e033d2a
4 changed files with 144 additions and 262 deletions

View File

@@ -18,7 +18,10 @@ from sqlalchemy.orm.exc import NoResultFound
from app import db, redis_store
from app.aws import s3
from app.celery.nightly_tasks import cleanup_unfinished_jobs
from app.celery.tasks import process_row
from app.celery.tasks import (
generate_notification_reports_task,
process_row,
)
from app.dao.annual_billing_dao import (
dao_create_or_update_annual_billing_for_year,
set_default_free_allowance_for_service,
@@ -810,6 +813,11 @@ def update_templates():
_clear_templates_from_cache()
@notify_command(name="generate-notification-reports")
def generate_notification_reports():
generate_notification_reports_task()
def _clear_templates_from_cache():
# When we update-templates in the db, we need to make sure to delete them
# from redis, otherwise the old versions will stick around forever.