mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-19 05:58:53 -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
|
||||
Reference in New Issue
Block a user