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]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue