use celery
This commit is contained in:
parent
b05f8fdb83
commit
a03817ae38
9 changed files with 17 additions and 36 deletions
|
|
@ -1,22 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# vi:si:et:sw=4:sts=4:ts=4
|
||||
|
||||
import os
|
||||
from os.path import join, dirname, basename, splitext, exists
|
||||
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
from django.conf import settings
|
||||
|
||||
from ... import daemon
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
"""
|
||||
listen to rabbitmq and execute background task.
|
||||
"""
|
||||
help = 'listen to rabbitmq and execute background task.'
|
||||
args = ''
|
||||
|
||||
def handle(self, **options):
|
||||
daemon.run()
|
||||
|
||||
|
|
@ -29,7 +29,7 @@ import oxlib
|
|||
|
||||
import models
|
||||
import utils
|
||||
from daemon import send_bg_message
|
||||
import tasks
|
||||
|
||||
from oxuser.models import getUserJSON
|
||||
from oxuser.views import api_login, api_logout, api_register, api_contact, api_recover, api_preferences
|
||||
|
|
@ -477,7 +477,7 @@ def api_update(request):
|
|||
f = models.ArchiveFile.get_or_create(archive, oshash)
|
||||
f.update(data)
|
||||
if not f.file.movie:
|
||||
send_bg_message({'findMovie': f.file.id})
|
||||
task.findMovie(f.file.id)
|
||||
#FIXME: only add if it was not in File
|
||||
else:
|
||||
f = q[0]
|
||||
|
|
|
|||
|
|
@ -17,5 +17,5 @@ sys.path.append(os.path.join(root_dir, project_module))
|
|||
from django.core.management import execute_manager
|
||||
|
||||
import settings
|
||||
execute_manager(settings, ['pandora-encoder', 'encoder'])
|
||||
execute_manager(settings, ['celeryd', 'celeryd', '-Q' 'encoding'])
|
||||
|
||||
|
|
@ -17,5 +17,5 @@ sys.path.append(os.path.join(root_dir, project_module))
|
|||
from django.core.management import execute_manager
|
||||
|
||||
import settings
|
||||
execute_manager(settings, ['backgroundtasks', 'backgroundtasks'])
|
||||
execute_manager(settings, ['celeryd', 'celeryd', '-Q' 'default'])
|
||||
|
||||
|
|
@ -5,7 +5,7 @@ import os
|
|||
from os.path import join
|
||||
|
||||
SITENAME = 'Pandora'
|
||||
URL = 'pandora.Oxdb.org'
|
||||
URL = 'pan.do/ra'
|
||||
|
||||
PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__))
|
||||
|
||||
|
|
@ -33,6 +33,7 @@ DATABASE_PORT = '' # Set to empty string for default. Not used with
|
|||
#CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
|
||||
|
||||
#rabbitmq connection settings
|
||||
CELERY_RESULT_BACKEND = "database"
|
||||
BROKER_HOST = "127.0.0.1"
|
||||
BROKER_PORT = 5672
|
||||
BROKER_USER = "pandora"
|
||||
|
|
@ -106,6 +107,7 @@ INSTALLED_APPS = (
|
|||
'django_extensions',
|
||||
'devserver',
|
||||
# 'south',
|
||||
'djcelery',
|
||||
|
||||
'app',
|
||||
'backend',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue