From 2bfcd4a54d063fd9fbe555899e5cb4b781c47088 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 10 Jul 2025 09:43:32 -0700 Subject: [PATCH] fix cronitor --- app/celery/nightly_tasks.py | 9 ++------- app/config.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/celery/nightly_tasks.py b/app/celery/nightly_tasks.py index f63aa2f2c..d6bee1052 100644 --- a/app/celery/nightly_tasks.py +++ b/app/celery/nightly_tasks.py @@ -8,7 +8,6 @@ from app.aws import s3 from app.aws.s3 import remove_csv_object from app.celery.process_ses_receipts_tasks import check_and_queue_callback_task from app.config import QueueNames -from app.cronitor import cronitor from app.dao.fact_processing_time_dao import insert_update_processing_time from app.dao.inbound_sms_dao import delete_inbound_sms_older_than_retention from app.dao.jobs_dao import ( @@ -31,7 +30,6 @@ from app.utils import get_midnight_in_utc, utc_now @notify_celery.task(name="remove-sms-email-jobs") -@cronitor("remove-sms-email-jobs") def remove_sms_email_csv_files(): _remove_csv_files([NotificationType.EMAIL, NotificationType.SMS]) @@ -76,13 +74,13 @@ def delete_notifications_older_than_retention(): @notify_celery.task(name="delete-sms-notifications") -@cronitor("delete-sms-notifications") +# @cronitor("delete-sms-notifications") def delete_sms_notifications_older_than_retention(): _delete_notifications_older_than_retention_by_type(NotificationType.SMS) @notify_celery.task(name="delete-email-notifications") -@cronitor("delete-email-notifications") +# @cronitor("delete-email-notifications") def delete_email_notifications_older_than_retention(): _delete_notifications_older_than_retention_by_type(NotificationType.EMAIL) @@ -162,7 +160,6 @@ def delete_notifications_for_service_and_type( @notify_celery.task(name="timeout-sending-notifications") -@cronitor("timeout-sending-notifications") def timeout_notifications(): notifications = ["dummy value so len() > 0"] @@ -184,7 +181,6 @@ def timeout_notifications(): @notify_celery.task(name="delete-inbound-sms") -@cronitor("delete-inbound-sms") def delete_inbound_sms(): try: start = utc_now() @@ -200,7 +196,6 @@ def delete_inbound_sms(): @notify_celery.task(name="save-daily-notification-processing-time") -@cronitor("save-daily-notification-processing-time") def save_daily_notification_processing_time(local_date=None): # local_date is a string in the format of "YYYY-MM-DD" if local_date is None: diff --git a/app/config.py b/app/config.py index 18b191e1e..2033baed1 100644 --- a/app/config.py +++ b/app/config.py @@ -316,6 +316,16 @@ class Config(object): "schedule": crontab(hour=8, minute=0), "options": {"queue": QueueNames.PERIODIC}, }, + "delete-sms-notifications": { + "task": "delete-sms-notifications", + "schedule": crontab(hour=8, minute=46), + "options": {"queue": QueueNames.PERIODIC}, + }, + "delete-email-notifications": { + "task": "delete-sms-notifications", + "schedule": crontab(hour=8, minute=17), + "options": {"queue": QueueNames.PERIODIC}, + }, "check-for-services-with-high-failure-rates-or-sending-to-tv-numbers": { "task": "check-for-services-with-high-failure-rates-or-sending-to-tv-numbers", "schedule": crontab(day_of_week="mon-fri", hour=14, minute=30),