From c55c733bcd3504f4e600d379b6b6812a1dc52073 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 5 Apr 2024 21:19:57 +0100 Subject: [PATCH] celery fixes --- pandora/taskqueue/models.py | 2 +- pandora/websocket/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/taskqueue/models.py b/pandora/taskqueue/models.py index baf18a86c..1d114a2cc 100644 --- a/pandora/taskqueue/models.py +++ b/pandora/taskqueue/models.py @@ -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() diff --git a/pandora/websocket/__init__.py b/pandora/websocket/__init__.py index e012f8683..ef74deedb 100644 --- a/pandora/websocket/__init__.py +++ b/pandora/websocket/__init__.py @@ -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)