celery fixes

This commit is contained in:
j 2024-04-05 21:19:57 +01:00
parent 853efbba9a
commit c55c733bcd
2 changed files with 3 additions and 3 deletions

View file

@ -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()

View file

@ -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)