Search code examples
pythonapiceleryseconds

Python : Celery, How can I make it run in background?


I use celery, with python 3 and supervisor in Ubuntu.

I've been working to make a new API, which will get an image from the internet using PIL(Pillow) and save it in a server.

However the problem is that I use Celery as scheduler and in the original API it returns the result in a milisecond, but when I use PIL, the wait becomes almost a second.

So as a solution, I am looking for a way to make the Celery worker run in the background.

Is it possible?


Solution

  • What you probably want is to daemonize your Celery worker.

    If you follow the steps provided in the Celery running the worker as a daemon documentation you will be able to do that.

    It is a bit of a complicated process, but it will allow the Celery worker to run in the background