Better kill command

This commit is contained in:
Adam La Morre 2022-02-06 18:42:26 -08:00
parent efaaa3026b
commit 03f9c2298b
2 changed files with 4 additions and 2 deletions

View File

@ -203,7 +203,7 @@ class WebRequest(http.Request):
self.server._complete_requests_counted += 1
if self.server._complete_requests_counted > self.server.max_requests:
logger.info('Max requests completed. Shutting down daphne...')
bash_command = 'kill $(ps -a | grep daphne | cut -f 1 -d " " | head -n 1)'
bash_command = "kill $(ps aux | grep 'daphne' | awk '{print $2}')"
os.system(bash_command)
sys.exit(0)

View File

@ -2,4 +2,6 @@ Build: python setup.py sdist bdist_wheel
Test Upload: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Prod Upload: twine upload dist/*
Test Install: pip install -i https://test.pypi.org/simple/ adam-daphne==3.0.9
Test Install: pip install -i https://test.pypi.org/simple/ adam-daphne==3.0.9
Uninstall everything: pip freeze | xargs pip uninstall -y