Bogdanp / django_dramatiq

A Django app that integrates with Dramatiq.
https://dramatiq.io
Other
331 stars 77 forks source link

How to stop/terminate dramatiq? #78

Closed knguyen1794 closed 3 years ago

knguyen1794 commented 3 years ago

I have dramatiq running in the background as I have a script set up to run "python manage.py rundramatiq" when system starts up. However I couldn't find a way to terminal the running dramatiq.

Bogdanp commented 3 years ago

You should find the process id and send it a SIGTERM signal. On UNIX you would run ps aux | grep dramatiq, take the process id (2nd column) and pass it to kill (eg. kill 123).

knguyen1794 commented 3 years ago

You should find the process id and send it a SIGTERM signal. On UNIX you would run ps aux | grep dramatiq, take the process id (2nd column) and pass it to kill (eg. kill 123).

Thanks. I will take a look on how to do it. Pull request for the Docs is welcome?

Bogdanp commented 3 years ago

I don't think a documentation change is necessary here, but thank you for offering. How to do this is general systems administration knowledge and not related to dramatiq specifically.

jenstroeger commented 11 months ago

@Bogdanp sending SIGTERM to the dramatiq process will stop it from pulling messages off the queue, but will wait for all workers to finish processing their messages — correct? (See also Deploy best practices.)