feat(chalice): changed pg_helper default timeout for no-pool connexion

This commit is contained in:
Taha Yassine Kraiem 2022-10-13 18:13:07 +02:00
parent 378f2196df
commit 419f834b9a

View file

@ -109,7 +109,7 @@ class PostgresClient:
elif not config('PG_POOL', cast=bool, default=True):
single_config = dict(_PG_CONFIG)
single_config["application_name"] += "-NOPOOL"
single_config["options"] = f"-c statement_timeout={config('PG_TIMEOUT', cast=int, default=3 * 60) * 1000}"
single_config["options"] = f"-c statement_timeout={config('PG_TIMEOUT', cast=int, default=30) * 1000}"
self.connection = psycopg2.connect(**single_config)
else:
self.connection = postgreSQL_pool.getconn()