mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Refactor code
- Created TaskNames for DVLA_FILES rather than have DVLA_FILES in QueueNames - Removed PROCESS_FTP from all_queues() as this was causing problems in picking up letter job tasks - Created test to ensure that we don't arbitrarily add queue names to all_queues
This commit is contained in:
@@ -2,7 +2,7 @@ from flask import Blueprint, jsonify
|
||||
from flask import request
|
||||
|
||||
from app import notify_celery
|
||||
from app.config import QueueNames
|
||||
from app.config import QueueNames, TaskNames
|
||||
from app.dao.jobs_dao import dao_get_all_letter_jobs
|
||||
from app.schemas import job_schema
|
||||
from app.v2.errors import register_errors
|
||||
@@ -16,7 +16,7 @@ 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=QueueNames.DVLA_FILES, args=(job_ids['job_ids'],), queue=QueueNames.PROCESS_FTP)
|
||||
notify_celery.send_task(name=TaskNames.DVLA_FILES, args=(job_ids['job_ids'],), queue=QueueNames.PROCESS_FTP)
|
||||
|
||||
return jsonify(data={"response": "Task created to send files to DVLA"}), 201
|
||||
|
||||
|
||||
Reference in New Issue
Block a user