You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
998 B

from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
from raven import Client
from raven.contrib.celery import register_signal, register_logger_signal
from celery.schedules import crontab
from finance.tasks import periodic_billing
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'lms.settings')
app = Celery('lms')
app.config_from_object('django.conf:settings', namespace='CELERY')
app.autodiscover_tasks()
client = Client('http://caaea487274f4e23a9107862484c79f3:3d463ad4717942508536f7a659921950@sentry.skillbox.ru/7')
register_logger_signal(client)
register_signal(client)
@app.on_after_configure.connect
def setup_periodic_tasks(sender, **kwargs):
sender.add_periodic_task(
# crontab(minute='0',hour='*/3',),
crontab(minute='*/1'),
periodic_billing(),
)
@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))