Files
notifications-api/app/celery/canary_tasks.py
Katie Smith f793bb0922 wip
2021-02-03 13:13:50 +00:00

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