3 ms·
I suspect people jump to Celery when something much simpler would probably be enough. I've seen people use Celery with all the associated deployment and monitor
by andybak 12y ago
I suspect people jump to Celery when something much simpler would probably be enough. I've seen people use Celery with all the associated deployment and monitoring complexity when all they wanted to do was run a slow task without blocking a request.
You could simply use this: if all you need is to run a slow task and not block a request there's this: https://github.com/defrex/django-after-response https://github.com/defrex/django-after-response
I've usually used the system crontab (sometimes via https://github.com/andybak/django-cron https://github.com/andybak/django-cron ).
If you really really need a proper task queue then Huey is much lighter than Celery: https://huey.readthedocs.org/en/latest/ https://huey.readthedocs.org/en/latest/
If you do need something more than
- StavrosK 12y agodjango-after-response looks fantastic, it'll make 50% of my apps much easier. Does anyone know what the lifecycle of the spawned threads is like? I'm guessing it depends on the server, but it looks like request + tasks need to take less than 30 seconds total in order to not time out.
- defrex 12y agoYa, it depends on the upstream timeout for the process. I'm pretty sure to default for gunicorn is 30 seconds. After that the process will be killed, which kills the thread.