Menu
  • HOME
  • TAGS

Celery worker with Redis broker can't execute Django task

redis,celery,django-celery,celery-task,celerybeat

Wrong task name. This got fixed by changing the task decorator to @celery_app1.task(name='tasks.rank_all') and tweaking my beat schedule to include the correct name: CELERYBEAT_SCHEDULE = { 'tasks.rank_all': { 'task': 'tasks.rank_all', 'schedule': timedelta(seconds=30), }, } ...

Celery - Only one instance per task/process?

python,celery,celery-task,celerybeat

So, as per your comment, you need to maintain one connection per thread. Why not to use a thread storage then? It should be a safe solution in your case. from threading import local thread_storage = local() def get_or_create_conntection(*args, **kwargs): if not hasattr(thread_storage, 'connection'): thread_storage.connection = Connection(*args, **kwargs) return thread_storage.connection...

Deadlock when updating `djcelery_periodictask` table

celery,django-celery,database-deadlocks,celerybeat

My problem was that I had all of my workers started with -B parameter which turned each worker in a periodic task scheduler: -B, --beat Also run the celery beat periodic task scheduler. Please note that there must only be one instance of this service. As a result, the scheduled...

celerybeat - multiple instances & monitoring

python,python-2.7,celery,celerybeat

To answer your 2 questions: If you run several celerybeat instances you get duplicated tasks, so afaik you should have only single celerybeat instance. I'm using supervisord as you mentioned to run celery workers and celerybeat workers as deamon so they should always be up & running. my supervisord config:...

How to make two tasks mutually exclusive in Celery?

python-2.7,celery,celery-task,celerybeat

Yes, if you don't need to worry about overall throughput it is possible to create a separate queue and have a dedicated worker with concurrency set to 1. You can create as many queues as you want and configure which of those queues each worker receives messages from. When starting...

Celery : Execute task after a specific time gap

django,celery,django-celery,celery-task,celerybeat

You'll want to make use of ETA. Read that section of the docs as it'll have more information. However, your code will look something like this: from datetime import datetime, timedelta send_date = datetime.utcnow() + timedelta(days=2) email_user.apply_async([user], eta=send_date) ...

celery beat schedule arguments [closed]

python,scheduled-tasks,celerybeat

From your comment: function(argument)-> what is workers execute. function(arg1), function(arg2) .... I want this: you can accomplish this work in many ways, for this argument should be an iterator e.g. list, tuple: 1) Suppose if your function don't return any value just process argi ∈ arguments (for example prints) then...

What is the best “architecture” for running celery (and celery beat) in production environment (debian server)?

django,debian,celery,virtualenv,celerybeat

Based on Chris's answer, the solution how to restart supervisord program without sudo permission: You have to edit supervisord.conf to change socket permissions (in my case located at /etc/supervisor/supervisord.conf] [unix_http_server] file=/var/run//supervisor.sock ; (the path to the socket file) chmod=0766 ; sockef file mode (default 0700) Then you have to make...

Django/Celery multiple queues on localhost - routing not working

python,django,celery,celerybeat

Ok, so i figured it out. Following is my whole setup, settings and how to run celery, for those who might be wondering about same thing as my question did. Settings CELERY_TIMEZONE = TIME_ZONE CELERY_ACCEPT_CONTENT = ['json', 'pickle'] CELERYD_CONCURRENCY = 2 CELERYD_MAX_TASKS_PER_CHILD = 4 CELERYD_PREFETCH_MULTIPLIER = 1 # celery queues...

Celery, AttributeError: 'module' object has no attribute 'celeryconfig'

python,celery,cron-task,celerybeat,periodic-task

The problem was that I should have imported absolute_import from __future__ in celeryconfig.py Doing this solved the problem. from __future__ import absolute_import ...