mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-15 15:28:02 -04:00
20 lines
498 B
Python
20 lines
498 B
Python
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
|