mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Merge pull request #55 from alphagov/update_queue_names
Update queues with a prefix.
This commit is contained in:
@@ -7,7 +7,9 @@ from flask import current_app
|
|||||||
def add_notification_to_queue(service_id, template_id, type_, notification):
|
def add_notification_to_queue(service_id, template_id, type_, notification):
|
||||||
q = boto3.resource(
|
q = boto3.resource(
|
||||||
'sqs', region_name=current_app.config['AWS_REGION']
|
'sqs', region_name=current_app.config['AWS_REGION']
|
||||||
).create_queue(QueueName=str(service_id))
|
).create_queue(QueueName="{}_{}".format(
|
||||||
|
current_app.config['NOTIFICATION_QUEUE_PREFIX'],
|
||||||
|
str(service_id)))
|
||||||
message_id = str(uuid.uuid4())
|
message_id = str(uuid.uuid4())
|
||||||
serializer = URLSafeSerializer(current_app.config.get('SECRET_KEY'))
|
serializer = URLSafeSerializer(current_app.config.get('SECRET_KEY'))
|
||||||
encrypted = serializer.dumps(notification, current_app.config.get('DANGEROUS_SALT'))
|
encrypted = serializer.dumps(notification, current_app.config.get('DANGEROUS_SALT'))
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ class Config(object):
|
|||||||
|
|
||||||
AWS_REGION = 'eu-west-1'
|
AWS_REGION = 'eu-west-1'
|
||||||
NOTIFY_JOB_QUEUE = os.getenv('NOTIFY_JOB_QUEUE', 'notify-jobs-queue')
|
NOTIFY_JOB_QUEUE = os.getenv('NOTIFY_JOB_QUEUE', 'notify-jobs-queue')
|
||||||
|
# Notification Queue names are a combination of a prefx plus a name
|
||||||
|
NOTIFICATION_QUEUE_PREFIX = 'notification'
|
||||||
|
|
||||||
|
|
||||||
class Development(Config):
|
class Development(Config):
|
||||||
|
|||||||
Reference in New Issue
Block a user