Skip to content

Commit

Permalink
Can now stop the WSGI app without kill -9
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Valsecchi committed Mar 27, 2017
1 parent 5f1e6f4 commit 91f7488
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions acceptance_tests/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ENV LOG_PORT 514
ENV SQL_LOG_LEVEL WARN
ENV OTHER_LOG_LEVEL WARN
ENV DEVELOPMENT 0
ENV SQLALCHEMY_URL postgresql://www-data:www-data@db:5432/test
ENV SQLALCHEMY_URL_SLAVE postgresql://www-data:www-data@db_slave:5432/test

# Step #2 copy the rest of the files (watch for the .dockerignore)
COPY . /app
Expand Down
13 changes: 11 additions & 2 deletions c2cwsgiutils_run
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from setuptools import setup, find_packages


VERSION = '0.5.0'
VERSION = '0.5.1'
HERE = os.path.abspath(os.path.dirname(__file__))
INSTALL_REQUIRES = open(os.path.join(HERE, 'rel_requirements.txt')).read().splitlines()

Expand Down

0 comments on commit 91f7488

Please sign in to comment.