]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
style(pool): don't report too many decimals in timeout error message
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 6 Oct 2023 12:38:44 +0000 (14:38 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 6 Oct 2023 15:08:13 +0000 (17:08 +0200)
psycopg_pool/psycopg_pool/pool.py
psycopg_pool/psycopg_pool/pool_async.py

index a67e29adfc58af9b97a3216d00ca08fa947e067d..9c3c7dc3cebb9f4b1c2ef440f49b3e55a0eed970 100644 (file)
@@ -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
index 03dd61e1c4b069a35c26cc58c012fcc7ee3c5c48..8d9184620307f89b7a9f54b6913e75caef99c9e7 100644 (file)
@@ -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