From: Daniele Varrazzo Date: Fri, 6 Oct 2023 12:38:44 +0000 (+0200) Subject: style(pool): don't report too many decimals in timeout error message X-Git-Tag: pool-3.1.9~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb2619e666f4a4b963aa3fad6b004c65f1444e3f;p=thirdparty%2Fpsycopg.git style(pool): don't report too many decimals in timeout error message --- diff --git a/psycopg_pool/psycopg_pool/pool.py b/psycopg_pool/psycopg_pool/pool.py index a67e29adf..9c3c7dc3c 100644 --- a/psycopg_pool/psycopg_pool/pool.py +++ b/psycopg_pool/psycopg_pool/pool.py @@ -744,7 +744,7 @@ class WaitingClient: try: if not self._cond.wait(timeout): self.error = PoolTimeout( - f"couldn't get a connection after {timeout} sec" + f"couldn't get a connection after {timeout:.2f} sec" ) except BaseException as ex: self.error = ex diff --git a/psycopg_pool/psycopg_pool/pool_async.py b/psycopg_pool/psycopg_pool/pool_async.py index 03dd61e1c..8d9184620 100644 --- a/psycopg_pool/psycopg_pool/pool_async.py +++ b/psycopg_pool/psycopg_pool/pool_async.py @@ -671,7 +671,7 @@ class AsyncClient: await asyncio.wait_for(self._cond.wait(), timeout) except asyncio.TimeoutError: self.error = PoolTimeout( - f"couldn't get a connection after {timeout} sec" + f"couldn't get a connection after {timeout:.2f} sec" ) except BaseException as ex: self.error = ex