forked from 0x2620/pandora
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()
|
||||
if job:
|
||||
print(job)
|
||||
r = celery.task.control.revoke(job['id'])
|
||||
r = app.control.revoke(job['id'])
|
||||
print(r)
|
||||
for f in self.item.files.filter(encoding=True):
|
||||
f.delete()
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from celery.execute import send_task
|
||||
from django.conf import settings
|
||||
from app.celery import app
|
||||
|
||||
|
||||
key = 'websocket'
|
||||
|
||||
def trigger_event(event, data):
|
||||
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