Category : celery-task

i’m new in celery there is a simple task that I want to use celery in Django but in celery log there isn’t any message to get task. these are my codes: celery.py: from __future__ import absolute_import, unicode_literals from celery import Celery app = Celery(‘kia’, broker=’redis://localhost:6379/0′) app.conf.update( result_serializer=’json’, accept_content = [‘application/json’], task_serializer = ‘json’ ) ..

Read more

I’m having the following configuration: class Foo: def __init__(self, services: List[str]): self.services = services def enqueuer(self, func): def wrapper(*args, **kwargs): if not args[1] in self.services: raise ForbiddenServiceError return func.delay(*args, **kwargs) return wrapper @enqueuer @celery_app.task() def foo_task(self, data, service: str): time.sleep(10) print(f"Received the service: {service} with data: {data}") foo = Foo(["service1", "service2"]) foo.foo_task("Dummy data", "service1") Will ..

Read more

I’m running a selenium webdriver in a celery task. However, in some cases, I need to revoke/terminate the celery task. I successfully terminate the celery task using the following >>> from proj.celery import app >>> app.control.revoke(task_id, terminate=True) However, the webdriver remains open when the task is terminated has been terminated. How can I quit the ..

Read more

I am using celery in both the projects. Redis is used as a broker and backend. Suppose project A has task @shared_task() def add(x,y): return x+y Now I want to send this task in Project B and execute it there. Is there any possible way to do so? Both the project has configuration like this ..

Read more

I’m trying to run celery in background with help of supervisord on ubuntu system. I’ve a Flask application located at ~/celery directory. I followed following steps to run celery with background: #install supervisor sudo apt-get install supervisor Created configuration in /etc/supervisor/conf.d/celery.conf: [program:celery] directory=~/celery command=cd ~/celery && /home/ubuntu/.local/bin/celery -A batch.celery worker -f celery.logs –loglevel=INFO numprocs=1 autostart=true ..

Read more