mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
Remove the beat job.
Add logging to the task.
This commit is contained in:
@@ -51,9 +51,11 @@ def run_scheduled_jobs():
|
|||||||
@statsd(namespace="tasks")
|
@statsd(namespace="tasks")
|
||||||
def send_scheduled_notifications():
|
def send_scheduled_notifications():
|
||||||
try:
|
try:
|
||||||
for notification in dao_get_scheduled_notifications():
|
scheduled_notifications = dao_get_scheduled_notifications()
|
||||||
|
for notification in scheduled_notifications:
|
||||||
send_notification_to_queue(notification, notification.service.research_mode)
|
send_notification_to_queue(notification, notification.service.research_mode)
|
||||||
|
current_app.logger.info(
|
||||||
|
"Sent {} scheudled notifications to the provider queue".format(len(scheduled_notifications)))
|
||||||
except SQLAlchemyError as e:
|
except SQLAlchemyError as e:
|
||||||
current_app.logger.exception("Failed to send scheduled notifications")
|
current_app.logger.exception("Failed to send scheduled notifications")
|
||||||
raise
|
raise
|
||||||
|
|||||||
@@ -109,11 +109,6 @@ class Config(object):
|
|||||||
'schedule': crontab(minute=1),
|
'schedule': crontab(minute=1),
|
||||||
'options': {'queue': 'periodic'}
|
'options': {'queue': 'periodic'}
|
||||||
},
|
},
|
||||||
'send-scheduled-notifications': {
|
|
||||||
'task': 'send-scheduled-notifications',
|
|
||||||
'schedule': crontab(minute=1),
|
|
||||||
'options': {'queue': 'periodic'}
|
|
||||||
},
|
|
||||||
'delete-verify-codes': {
|
'delete-verify-codes': {
|
||||||
'task': 'delete-verify-codes',
|
'task': 'delete-verify-codes',
|
||||||
'schedule': timedelta(minutes=63),
|
'schedule': timedelta(minutes=63),
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
9772
|
|
||||||
Reference in New Issue
Block a user