Skip to content

Commit

Permalink
add celery task
Browse files Browse the repository at this point in the history
  • Loading branch information
depsiatwal committed Feb 12, 2024
1 parent 59e3e36 commit 324a51c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/cases/celery_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def schedule_all_ecju_query_chaser_emails():
"""
Sends an ECJU 15 working days reminder
Runs as a background task daily at a given time.
Doesn't run on non-working days (bank-holidays & weekends)
Can accommodate reruns and can send reminders if any have been missed upto 20 days after ECJU Query created
"""
logger.info("Sending all ECJU query chaser emails started")

Expand Down
6 changes: 5 additions & 1 deletion api/cases/tests/test_case_ecju_queries.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from api.conf import settings
from django.conf import settings
import pytest
import datetime
from unittest import mock
Expand Down Expand Up @@ -692,6 +692,10 @@ class ECJUQueriesChaserNotificationTests(DataTestClient):
def setUp(self):
super().setUp()
settings.GOV_NOTIFY_ENABLED = True
# Require a valid formatted key else NotificationsAPIClient will complain with missing service id key.
settings.GOV_NOTIFY_KEY = (
"faketestkey-aa1539a1-0ba4-4ac2-b6ff-ae557aed2169-aa1539a1-0ba4-4ac2-b6ff-ae557aed2169"
)
self.case = self.create_standard_application_case(self.organisation)
self.date_15_working_days_from_today = datetime.datetime(2024, 1, 16, 12, 00)

Expand Down
2 changes: 1 addition & 1 deletion api/conf/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
},
"send ecju query chaser emails 8pm, 4pm": {
"task": "api.cases.celery_tasks.schedule_all_ecju_query_chaser_emails",
"schedule": crontab(hour="8, 16", minute=0),
"schedule": crontab(hour="8, 12, 13, 15 ,16", minute=0),
},
}

0 comments on commit 324a51c

Please sign in to comment.