mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-12 18:08:05 -04:00
wip
This commit is contained in:
@@ -60,6 +60,7 @@ performance_platform_client = PerformancePlatformClient()
|
||||
cbc_proxy_client = CBCProxyClient()
|
||||
document_download_client = DocumentDownloadClient()
|
||||
metrics = GDSMetrics()
|
||||
counter = 0
|
||||
|
||||
notification_provider_clients = NotificationProviderClients()
|
||||
|
||||
|
||||
19
app/celery/canary_tasks.py
Normal file
19
app/celery/canary_tasks.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from flask import current_app
|
||||
from notifications_utils.statsd_decorators import statsd
|
||||
|
||||
from app import counter, notify_celery
|
||||
|
||||
|
||||
@statsd(namespace="tasks")
|
||||
def canary_passing_task():
|
||||
global counter
|
||||
counter += 1
|
||||
|
||||
current_app.logger.info(f'The counter is {counter}.')
|
||||
|
||||
|
||||
@notify_celery.task(name="canary_failing_task", max_retries=60, default_retry_delay=30)
|
||||
@statsd(namespace="tasks")
|
||||
def canary_failing_task():
|
||||
current_app.logger.info('Calling the failing task')
|
||||
raise Exception
|
||||
@@ -68,6 +68,7 @@
|
||||
'notify-delivery-worker-receipts': {},
|
||||
'notify-delivery-worker-service-callbacks': {'disk_quota': '2G'},
|
||||
'notify-delivery-worker-save-api-notifications': {'disk_quota': '2G'},
|
||||
'notify-delivery-worker-canary': {'disk_quota': '2G'},
|
||||
} -%}
|
||||
|
||||
{%- set app = app_vars[CF_APP] -%}
|
||||
|
||||
@@ -57,6 +57,10 @@ case $NOTIFY_APP_NAME in
|
||||
exec scripts/run_app_paas.sh celery -A run_celery.notify_celery worker --loglevel=INFO --concurrency=11 \
|
||||
-Q save-api-email-tasks,save-api-sms-tasks 2> /dev/null
|
||||
;;
|
||||
delivery-worker-canary)
|
||||
exec scripts/run_app_paas.sh celery -A run_celery.notify_celery worker --loglevel=INFO --concurrency=11 \
|
||||
-Q canary-a,canary-b 2> /dev/null
|
||||
;;
|
||||
delivery-celery-beat)
|
||||
exec scripts/run_app_paas.sh celery -A run_celery.notify_celery beat --loglevel=INFO
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user