mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-14 23:07:49 -04:00
add CBC_PROXY_ENABLED config flag to control if tasks are triggered
previously we made some incorrect assumptions about set-up on staging and prod - they currently don't have any cbc_proxy aws creds at all. We shoudn't be attempting canaries or link tests when there's no AWS infrastructure to connect to. We also shouldn't bother writing a row into the database at all for the broadcast_provider_message since we're not even attempting to send, and we shouldn't get confused between messages that failed and messages we never wanted to send at all.
This commit is contained in:
@@ -12,6 +12,10 @@ from app.dao.broadcast_message_dao import dao_get_broadcast_event_by_id, create_
|
||||
@notify_celery.task(name="send-broadcast-event")
|
||||
@statsd(namespace="tasks")
|
||||
def send_broadcast_event(broadcast_event_id):
|
||||
if not current_app.config['CBC_PROXY_ENABLED']:
|
||||
current_app.logger.info(f'CBC Proxy disabled, not sending broadcast_event {broadcast_event_id}')
|
||||
return
|
||||
|
||||
for provider in current_app.config['ENABLED_CBCS']:
|
||||
# TODO: Decide whether to send to each provider based on platform admin, service level settings, broadcast
|
||||
# level settings, etc.
|
||||
|
||||
Reference in New Issue
Block a user