mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 02:11:11 -05:00
New endpoint to send a list of job ids to a queue.
The task will be picked up by the FTP app. Given the list of job ids the tasks will get all the files from s3, aggregate them then send to dvla
This commit is contained in:
18
app/letters/send_letter_jobs.py
Normal file
18
app/letters/send_letter_jobs.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from flask import Blueprint
|
||||
from flask import request
|
||||
|
||||
from app import notify_celery
|
||||
from app.v2.errors import register_errors
|
||||
from app.letters.letter_schemas import letter_job_ids
|
||||
from app.schema_validation import validate
|
||||
|
||||
letter_job = Blueprint("letter-job", __name__)
|
||||
register_errors(letter_job)
|
||||
|
||||
|
||||
@letter_job.route('/send-letter-jobs', methods=['POST'])
|
||||
def send_letter_jobs():
|
||||
job_ids = validate(request.get_json(), letter_job_ids)
|
||||
notify_celery.send_task(name="send_files_to_dvla", args=(job_ids['job_ids'],), queue="process-ftp")
|
||||
|
||||
return "Task created to send files to DVLA"
|
||||
Reference in New Issue
Block a user