This commit is contained in:
Katie Smith
2021-02-03 11:54:51 +00:00
parent 41b54b81ee
commit f793bb0922
4 changed files with 25 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ performance_platform_client = PerformancePlatformClient()
cbc_proxy_client = CBCProxyClient()
document_download_client = DocumentDownloadClient()
metrics = GDSMetrics()
counter = 0
notification_provider_clients = NotificationProviderClients()

View 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

View File

@@ -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] -%}

View File

@@ -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
;;