Completed
Push — master ( 2c16e2...2c16e2 )
by Paolo
13s queued 11s
created

image.celery.MyTask.on_failure()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
cc 1
nop 6
1
#!/usr/bin/env python3
2
# -*- coding: utf-8 -*-
3
"""
4
Created on Tue Sep 11 14:34:27 2018
5
6
@author: Paolo Cozzi <[email protected]>
7
"""
8
9
import os
10
11
from celery import Celery
12
from celery.signals import setup_logging
13
14
from django.conf import settings
15
16
17
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'image.settings')
18
19
app = Celery('proj')
20
21
app.config_from_object('django.conf:settings', namespace='CELERY')
22
23
app.autodiscover_tasks()
24
25
26
# configure logging
27
# https://groups.google.com/forum/#!topic/celery-users/mhcwubJTTnw
28
@setup_logging.connect
29
def configure_logging(sender=None, **kwargs):
30
    import logging
31
    import logging.config
32
    logging.config.dictConfig(settings.LOGGING)
33