celery fixes
This commit is contained in:
parent
853efbba9a
commit
c55c733bcd
2 changed files with 3 additions and 3 deletions
|
@ -167,7 +167,7 @@ class Task(models.Model):
|
||||||
job = self.get_job()
|
job = self.get_job()
|
||||||
if job:
|
if job:
|
||||||
print(job)
|
print(job)
|
||||||
r = celery.task.control.revoke(job['id'])
|
r = app.control.revoke(job['id'])
|
||||||
print(r)
|
print(r)
|
||||||
for f in self.item.files.filter(encoding=True):
|
for f in self.item.files.filter(encoding=True):
|
||||||
f.delete()
|
f.delete()
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from celery.execute import send_task
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from app.celery import app
|
||||||
|
|
||||||
|
|
||||||
key = 'websocket'
|
key = 'websocket'
|
||||||
|
|
||||||
def trigger_event(event, data):
|
def trigger_event(event, data):
|
||||||
if settings.WEBSOCKET:
|
if settings.WEBSOCKET:
|
||||||
send_task('trigger_event', [event, data], exchange=key, routing_key=key)
|
app.send_task('trigger_event', [event, data], exchange=key, routing_key=key)
|
||||||
|
|
Loading…
Reference in a new issue