Files
atst/atst/jobs.py
dandds d7478e322a Use Celery instead of RQ.
Celery provides a more robust set of queueing options for both tasks and
worker processes. Updates include:
- infrastructure necessary to run Celery, including celery entrypoint
- backgrounded functions are now imported directly from atst.jobs
- update tests as-needed
- update kubernetes worker pod command
2019-08-29 09:33:47 -04:00

19 lines
454 B
Python

from flask import current_app as app
from atst.queue import celery
@celery.task()
def send_mail(recipients, subject, body):
app.mailer.send(recipients, subject, body)
@celery.task()
def send_notification_mail(recipients, subject, body):
app.logger.info(
"Sending a notification to these recipients: {}\n\nSubject: {}\n\n{}".format(
recipients, subject, body
)
)
app.mailer.send(recipients, subject, body)