remove duplication shutdown loggers

also add **kwargs to make it celery4 compatible
This commit is contained in:
Leo Hemsted
2018-07-12 15:09:38 +01:00
parent 87013d9399
commit 6e87b36303
4 changed files with 7 additions and 19 deletions

View File

@@ -5,7 +5,6 @@ from datetime import (
)
import pytz
from celery.signals import worker_process_shutdown
from flask import current_app
from notifications_utils.statsd_decorators import statsd
from sqlalchemy import and_, func
@@ -74,11 +73,6 @@ from app.utils import (
from app.v2.errors import JobIncompleteError
@worker_process_shutdown.connect
def worker_process_shutdown(sender, signal, pid, exitcode):
current_app.logger.info('Scheduled tasks worker shutdown: PID: {} Exitcode: {}'.format(pid, exitcode))
@notify_celery.task(name="remove_csv_files")
@statsd(namespace="tasks")
def remove_csv_files(job_types):