mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 06:21:50 -05:00
New command to create-pdf-letter task for a given notification id.
After a notificaiton is created we create a task to create the pdf and save it to S3, if for some reason that task does not run we are left with notifications that are not sent. This should not happen, but if it does we have a way to continue sending the letter.
This commit is contained in:
@@ -12,6 +12,7 @@ from sqlalchemy.orm.exc import NoResultFound
|
||||
from app import db, DATETIME_FORMAT, encryption
|
||||
from app.celery.scheduled_tasks import send_total_sent_notifications_to_performance_platform
|
||||
from app.celery.service_callback_tasks import send_delivery_status_to_service
|
||||
from app.celery.letters_pdf_tasks import create_letters_pdf
|
||||
from app.config import QueueNames
|
||||
from app.dao.monthly_billing_dao import (
|
||||
create_or_update_monthly_billing,
|
||||
@@ -316,6 +317,14 @@ def insert_inbound_numbers_from_file(file_name):
|
||||
file.close()
|
||||
|
||||
|
||||
@notify_command(name='replay-create-pdf-letters')
|
||||
@click.option('-n', '--notification_id', required=True,
|
||||
help="Notification id of the letter that needs the create_letters_pdf task replayed")
|
||||
def replay_create_pdf_letters(notification_id):
|
||||
print("Create task to create_letters_pdf for notification: {}".format(notification_id))
|
||||
create_letters_pdf.apply_async([notification_id], queue=QueueNames.CREATE_LETTERS_PDF)
|
||||
|
||||
|
||||
@notify_command(name='replay-service-callbacks')
|
||||
@click.option('-f', '--file_name', required=True,
|
||||
help="""Full path of the file to upload, file is a contains client references of
|
||||
|
||||
Reference in New Issue
Block a user