Questions tagged [celery-task]

celery-task is a building block of Celery distributed task queue system

celery-task is a building block of Celery distributed task queue system. Basically, it is a python class, but it can be created out of any callable by @celery.task decorator.

727 questions
10
votes
3 answers

How to enter arguments of celery jobs into database to be queried; using mysql

I am using MySql as result backend for celery. I want to store program arguments in DB too. For example: add.apply_async(args=[num1, num2, user] In this case I want to store user argument in DB, so that I can query later. Currently, I return…
Rajs123
  • 663
  • 13
  • 30
10
votes
1 answer

Django Celery implementation - OSError : [Errno 38] Function not implemented

I installed django-celery and I tried to start up the worker server but I get an OSError that a function isn't implemented. I'm running CentOS release 5.4 (Final) on a VPS: . broker -> amqp://guest@localhost:5672/ . queues -> .…
Jordan Messina
  • 1,511
  • 1
  • 16
  • 25
10
votes
3 answers

running celery as daemon using supervisor is not working

I have a django app in which it has a celery functionality, so i can able to run the celery sucessfully like below celery -A tasks worker --loglevel=info but as a known fact that we need to run it as a daemon and so i have written the below…
Shiva Krishna Bavandla
  • 25,548
  • 75
  • 193
  • 313
10
votes
2 answers

How to disable celery tasks while testing on django

Im trying to test some functions that include a call for celery tasks. the tasks involves a call to 3rd party websites and i need to avoid it during tests. Any idea how to disable all celery tasks during tests?
segalle
  • 436
  • 4
  • 15
10
votes
3 answers

In celery how to get the task status for all the tasks for specific task name?

In celery i want to get the task status for all the tasks for specific task name. For that tried below code. import celery.events.state # Celery status instance. stat = celery.events.state.State() # task_by_type will return list of tasks. query =…
Hitul Mistry
  • 2,105
  • 4
  • 21
  • 29
10
votes
1 answer

Celery - group inside a chain

I want to use a group (or chunks) inside a chain, like: chain(getRange.s(3), GROUP() , xsum.s() ) Where GROUP() is a group of double() tasks, i.e. group(double(0),double(1),double(2)). A similar question was posted in How to chain a Celery task…
sergiuz
  • 5,353
  • 1
  • 35
  • 51
9
votes
2 answers

Reset countdown on Celery task

I need to have a celery task run after a countdown, but be able to reset that countdown under certain conditions. For example, I want to call apply_async with countdown=15, but if certain event occurs before the task is executed, I'd like to set…
Facundo Olano
  • 2,492
  • 2
  • 26
  • 32
9
votes
5 answers

Celery - how to get task name by task id?

Celery - bottom line: I want to get the task name by using the task id (I don't have a task object) Suppose I have this code: res = chain(add.s(4,5), add.s(10)).delay() cache.save_task_id(res.task_id) And then in some other place: task_id =…
RNE
  • 211
  • 2
  • 7
9
votes
5 answers

How I can specify SQS queue name in celery

I need to replace my redis broker with SQS broker, while googleing it I came across many pages which tell how to use SQS with celery. As per my understanding, it creates own SQS queue, I have only one task and want to use already created SQS queue.
Pramod
  • 622
  • 9
  • 21
9
votes
2 answers

How to send celery all logs to a custom handler . in my case python-logstash handler

In my Celery application I am getting 2 types of logs on the console i.e celery application logs and task level logs (inside task I am using logger.INFO(str) syntax for logging) I wanted to send both of them to a custom handler (in my case…
Jameel Grand
  • 2,294
  • 16
  • 32
9
votes
3 answers

Celery - "WorkerLostError: Worker exited prematurely: signal 11 (SIGSEGV)"

I am working on a Django app locally that needs to take a CSV file as input and run some analysis on the file. I am running Celery, RabbitMQ, and web server locally. When I import the file, I see the following error on the Celery…
Joe Fusaro
  • 847
  • 2
  • 11
  • 23
9
votes
3 answers

AsyncResult(task_id) returns "PENDING" state even after the task started

In the project, I try to poll task.state of a long running task and update its running status. It worked in the development, but it won't work when I move the project on production server. I kept getting 'PENDING' even I can see the task started on…
user3795121
  • 93
  • 1
  • 4
8
votes
1 answer

Celery task - How to get custom state?

I have a number of Celery tasks for which they are long-running processes. As such, I'd like to implement a custom state in order to query their progress. According to the documentation, it is easy enough to implement a custom state for the given…
Jason
  • 11,263
  • 21
  • 87
  • 181
8
votes
2 answers

Abort a running task in Celery within django

I would like to be able to abort a task that is running from a Celery queue (using rabbitMQ). I call the task using task_id = AsyncBoot.apply_async(args=[name], name=name, connect_timeout=3) where AsyncBoot is a defined task. I can get the task ID…
Anon
  • 5,103
  • 11
  • 45
  • 58
8
votes
1 answer

Mocking a Celery task call in Python with patch

Patching a Celery task call with a mocked return value returns instead of the expected return_value defined by mock_task.get.return_value = "value". However, the mocked task functions correctly within my unit…
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287