新增数据类型转换

This commit is contained in:
wangjiming
2026-08-05 16:23:00 +08:00
parent b5c6557341
commit c64fa1cd61
10 changed files with 620 additions and 322 deletions

View File

@@ -378,7 +378,7 @@ class PlatformStore:
# request (notably expensive against the remote PostgreSQL instance).
# TCP keepalive 让操作系统持续保活连接,抵抗远程库空闲静默断连。
pool_kwargs = {
"connect_timeout": 5,
"connect_timeout": 30,
"keepalives": 1,
"keepalives_idle": 10,
"keepalives_interval": 5,
@@ -388,14 +388,14 @@ class PlatformStore:
conninfo=self.database_url,
kwargs=pool_kwargs,
min_size=2,
max_size=10,
max_size=20,
# 借出前校验连接可用性,避免执行 SQL 时才发现 [BAD] 再重建。
check=ConnectionPool.check_connection,
# 不主动回收空闲连接(远程库约 10s 断,由 keepalive 维持),
# 减少无谓的重建握手。
max_idle=0,
# 请求最多排队等待 5s避免雪崩时无限堆积
max_waiting=16,
# 请求最多排队等待,调大以适应远程库慢查询
max_waiting=50,
open=False,
)
# 注意:不要在此调用 pool.wait(),它会阻塞等待 min_size 个连接就绪,