update celery

master
Stepan Krapivin 8 years ago
parent 16608ac882
commit 78e522b1fa
  1. 1
      .gitignore
  2. 7
      batiskaf/__init__.py
  3. 2
      batiskaf/celery.py
  4. 6
      dtys/tasks.py
  5. 2
      start_celery.sh

1
.gitignore vendored

@ -25,3 +25,4 @@ static/cache/*
.sass-cache
local_*
*.log
/static/dtys_update

@ -0,0 +1,7 @@
from __future__ import absolute_import, unicode_literals
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app
__all__ = ['celery_app']

@ -9,7 +9,7 @@ from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'batiskaf.settings')
app = Celery('batiskaf')
app = Celery('batiskaf', broker='redis://localhost:6379/0')
# Using a string here means the worker will not have to
# pickle the object when using Windows.

@ -1,9 +1,9 @@
from celery import Celery
from celery import task
app = Celery('tasks', broker='redis://localhost:6379/0')
# app = Celery('tasks', broker='redis://localhost:6379/0')
@app.task
@task
def return_dtys(dtys_id):
from .models import DTYSModel

@ -1,3 +1,3 @@
#!/bin/bash
celery -A dtys.tasks worker --loglevel=info >> celery.log &
celery -A batiskaf worker --loglevel=info >> celery.log &

Loading…
Cancel
Save