-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Can now stop the WSGI app without kill -9
- Loading branch information
Patrick Valsecchi
committed
Mar 27, 2017
1 parent
5f1e6f4
commit 91f7488
Showing
3 changed files
with
14 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#!/bin/bash | ||
if [ -z "$GUNICORN_PARAMS" ] | ||
then | ||
GUNICORN_PARAMS="-b :80 --threads 10 --workers 5" | ||
GUNICORN_PARAMS="-b :80 --worker-class gthread --threads 10 --workers 5" | ||
fi | ||
|
||
trap ctrl_c TERM INT | ||
function ctrl_c() { | ||
echo "Caught a signal" | ||
kill -SIGINT $PID | ||
exit 1 | ||
} | ||
|
||
while true | ||
do | ||
gunicorn $GUNICORN_PARAMS c2cwsgiutils.wsgi_app:application | ||
gunicorn $GUNICORN_PARAMS c2cwsgiutils.wsgi_app:application & | ||
PID=$! | ||
wait $PID | ||
sleep 1 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters