简体   繁体   中英

Celery with redis as a queue - I cant find a way to find out what tasks are prefetched

Is there some way, how to retrieve info on tasks that are prefetched in celery with Redis as a queue?

This prefetched tasks are like ghosts. They are not being processed nor are waiting in the queue so I for redis they are invisible.

With rabbitMQ+celery I could see all tasks (combining the both's API). But with redis, I cant see anything (Actually I could only count tasks in the queue -> which is wrong, because tasks in the queue equals prefetched + queued). Celery's inspect is also not helpful.

Is there some simple solution, does redis has some nice API in python with which I could see where are my tasks?

Thanks in advance

Yes there is. The inspect API gives you ability to inspect reserved tasks. It is covered in the Commands section of the Celery documentation. Something like celery -A yourproj.app inspect registered should give you prefetched tasks of each worker. If you do not see anything in the output, that means there are no reserved tasks at that particular moment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM