chore(api): adjust monkey patching in gunicorn.conf.py (#26056)

This commit is contained in:
QuantumGhost
2025-09-22 18:23:01 +08:00
committed by GitHub
parent 75a10c276c
commit 1e3df09fc6
2 changed files with 27 additions and 14 deletions

View File

@@ -1,20 +1,11 @@
import logging
import psycogreen.gevent as pscycogreen_gevent # type: ignore
from grpc.experimental import gevent as grpc_gevent # type: ignore
_logger = logging.getLogger(__name__)
def _log(message: str):
_logger.debug(message)
# grpc gevent
grpc_gevent.init_gevent()
_log("gRPC patched with gevent.")
print("gRPC patched with gevent.", flush=True) # noqa: T201
pscycogreen_gevent.patch_psycopg()
_log("psycopg2 patched with gevent.")
print("psycopg2 patched with gevent.", flush=True) # noqa: T201
from app import app, celery