@@ -2988,10 +2988,13 @@ def __init__(self, config: dict) -> None:
2988
2988
logger .warning (f"could not connect to request log db: { e } " )
2989
2989
2990
2990
def initdb (self , name : str , opts : tornado .options .OptionParser ) -> None :
2991
- engine_type = options .config ["backends" ]["dbs" ][name ]["db" ]["engine" ]
2991
+ db_config = options .config ["backends" ]["dbs" ][name ]["db" ]
2992
+ engine_type = db_config ["engine" ]
2992
2993
if engine_type == "postgres" :
2993
2994
pool = postgres_init (
2994
- options .config ["backends" ]["dbs" ][name ]["db" ]["dbconfig" ]
2995
+ db_config ["dbconfig" ],
2996
+ db_config .get ("pool_min" , 3 ),
2997
+ db_config .get ("pool_max" , 5 ),
2995
2998
)
2996
2999
options .pgpools [name ] = pool
2997
3000
db = PostgresBackend (pool )
@@ -3002,9 +3005,14 @@ def initdb(self, name: str, opts: tornado.options.OptionParser) -> None:
3002
3005
def initdb_request_log (self ) -> None :
3003
3006
if not options .request_log :
3004
3007
return
3005
- engine_type = options .request_log .get ("db" ).get ("engine" )
3008
+ db_config = options .request_log .get ("db" )
3009
+ engine_type = db_config .get ("engine" )
3006
3010
if engine_type == "postgres" :
3007
- pool = postgres_init (options .request_log .get ("db" ).get ("dbconfig" ))
3011
+ pool = postgres_init (
3012
+ db_config .get ("dbconfig" ),
3013
+ db_config .get ("pool_min" , 3 ),
3014
+ db_config .get ("pool_max" , 5 ),
3015
+ )
3008
3016
try :
3009
3017
define ("pgpool_request_log" , pool )
3010
3018
except tornado .options .Error :
0 commit comments