Skip to content

Commit

Permalink
do not use --preload; added psycogreen and monkey patching to core
Browse files Browse the repository at this point in the history
  • Loading branch information
dodancs committed May 17, 2022
1 parent 9a58f1b commit 069d319
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile.bots
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ EXPOSE 80
ENV PYTHONPATH=/app
ENV MODULE_NAME run
ENV VARIABLE_NAME app
ENV GUNICORN_CMD_ARGS --timeout 120 --preload
ENV GUNICORN_CMD_ARGS --timeout 120
ENV WORKERS_PER_CORE 8

ENTRYPOINT ["/entrypoint.sh"]
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.collectors
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ EXPOSE 80
ENV PYTHONPATH=/app
ENV MODULE_NAME run
ENV VARIABLE_NAME app
ENV GUNICORN_CMD_ARGS --timeout 120 --preload
ENV GUNICORN_CMD_ARGS --timeout 120
ENV WORKERS_PER_CORE 8
ENV COLLECTOR_CONFIG_FILE /app/storage/id.txt

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.core
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ EXPOSE 80
ENV PYTHONPATH=/app
ENV MODULE_NAME run
ENV VARIABLE_NAME app
ENV GUNICORN_CMD_ARGS --timeout 120 --preload
ENV GUNICORN_CMD_ARGS --timeout 120
ENV WORKERS_PER_CORE 8

VOLUME ["/data"]
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.presenters
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ EXPOSE 80
ENV PYTHONPATH=/app
ENV MODULE_NAME run
ENV VARIABLE_NAME app
ENV GUNICORN_CMD_ARGS --timeout 120 --preload
ENV GUNICORN_CMD_ARGS --timeout 120
ENV WORKERS_PER_CORE 8

VOLUME ["/app/templates"]
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.publishers
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COPY ./src/publishers/. /app/
ENV PYTHONPATH=/app
ENV MODULE_NAME run
ENV VARIABLE_NAME app
ENV GUNICORN_CMD_ARGS --timeout 120 --preload
ENV GUNICORN_CMD_ARGS --timeout 120
ENV WORKERS_PER_CORE 8

ENTRYPOINT ["/entrypoint.sh"]
Expand Down
1 change: 1 addition & 0 deletions src/core/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Mako==1.1.0
MarkupSafe==1.1.0
marshmallow==3.5.0
marshmallow-enum==1.5.1
psycogreen==1.0.2
psycopg2-binary==2.8.4
PyJWT==1.7.1
python-dateutil==2.8.1
Expand Down
6 changes: 6 additions & 0 deletions src/core/run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#! /usr/bin/env python

# patch things
from gevent import monkey
monkey.patch_all()
from psycogreen import gevent as g
g.patch_psycopg()

from flask_sse import sse

from app import create_app
Expand Down

0 comments on commit 069d319

Please sign in to comment.