Remove the beat job.

Add logging to the task.
This commit is contained in:
Rebecca Law
2017-05-17 12:59:00 +01:00
parent 1034762489
commit 5f8338dd80
3 changed files with 4 additions and 8 deletions
+4 -2
View File
@@ -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
-5
View File
@@ -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
View File
@@ -1 +0,0 @@
9772