Skip to content

Commit

Permalink
Patch psycopg2 in post_fork().
Browse files Browse the repository at this point in the history
  • Loading branch information
NickFitz committed Feb 20, 2025
1 parent 65d8ebf commit 2533918
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions trade_remedies_api/config/gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
worker_connections = os.environ.get("GUNICORN_WORKER_CONNECTIONS", "10")
workers = os.environ.get("GUNICORN_WORKERS", "1")

patch_psycopg()
def post_fork(server, worker):
"""
Called just after a worker has been forked.
# def post_fork(server, worker):
# """
# Called just after a worker has been forked.
#
# Enables async processing in Psycopg2 if GUNICORN_ENABLE_ASYNC_PSYCOPG2 is set.
# """
# patch_psycopg()
# worker.log.info("Enabled async Psycopg2")
Enables async processing in Psycopg2 if GUNICORN_ENABLE_ASYNC_PSYCOPG2 is set.
"""
patch_psycopg()
worker.log.info("Enabled async Psycopg2")

0 comments on commit 2533918

Please sign in to comment.