From 03f9c2298b80a32288c13e3ab6bf992aff372485 Mon Sep 17 00:00:00 2001 From: Adam La Morre Date: Sun, 6 Feb 2022 18:42:26 -0800 Subject: [PATCH] Better kill command --- daphne/http_protocol.py | 2 +- notes.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/daphne/http_protocol.py b/daphne/http_protocol.py index ec9c0a9..d478d6c 100755 --- a/daphne/http_protocol.py +++ b/daphne/http_protocol.py @@ -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) diff --git a/notes.txt b/notes.txt index 950a717..cf469ab 100644 --- a/notes.txt +++ b/notes.txt @@ -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 \ No newline at end of file +Test Install: pip install -i https://test.pypi.org/simple/ adam-daphne==3.0.9 + +Uninstall everything: pip freeze | xargs pip uninstall -y