mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
Remove command to replay callbacks
In response to [1]. I've already removed the runbook that referred to this. [1]: https://github.com/alphagov/notifications-api/pull/3383#discussion_r765644576
This commit is contained in:
@@ -78,9 +78,6 @@ from app.models import (
|
||||
Service,
|
||||
User,
|
||||
)
|
||||
from app.notifications.notifications_ses_callback import (
|
||||
check_and_queue_callback_task,
|
||||
)
|
||||
from app.utils import get_london_midnight_in_utc
|
||||
|
||||
|
||||
@@ -280,23 +277,6 @@ def recreate_pdf_for_precompiled_or_uploaded_letter(notification_id):
|
||||
resanitise_pdf.apply_async([str(notification_id)], queue=QueueNames.LETTERS)
|
||||
|
||||
|
||||
@notify_command(name='replay-callbacks')
|
||||
@click.option('-f', '--file-name', required=True,
|
||||
help="""Full path of the file to upload, containing IDs of
|
||||
notifications that need the status to be sent to the service.""")
|
||||
def replay_callbacks(file_name):
|
||||
print("Replaying callbacks.")
|
||||
file = open(file_name)
|
||||
|
||||
for id in [id.strip() for id in file]:
|
||||
try:
|
||||
notification = Notification.query.filter_by(id=id).one()
|
||||
check_and_queue_callback_task(notification)
|
||||
print(f"Created callback task for notification: {id}.")
|
||||
except NoResultFound:
|
||||
print(f"ID: {id} was not found in notifications.")
|
||||
|
||||
|
||||
def setup_commands(application):
|
||||
application.cli.add_command(command_group)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user