Search code examples
djangocelerygit-bashcelery-taskcelerybeat

Exit server terminal while after celery execution


I have successfully created a periodic task which updates each minute, in a django app. I everything is running as expected, using celery -A proj worker -B.

I am aware that using celery -A proj worker -B to execute the task is not advised, however, it seems to be the only way for the task to be run periodically.

I am logging on to the server using GitBash, after execution, I would like to exit GitBash with the celery tasks still being executed periodically.

When I press ctrl+fn+shift it is a cold worker exit, which stops execution completely (which is not desirable).

Any help?


Solution

  • If you are on a linux server, You might want to use a process manager like supervisord or even systemd to keep your process running.

    On windows, one might look at running celery as a service or running as part of rabbitMQ.

    In WSL, it seems like a bat file will get wsl commands to run as a service.