迁移服务器;分开开发端与生产端;去除废弃接口;对象存储、Kong网关使用SSL;修改所有使用内网地址的代码;切换域名;更新Ktor、ws-scrcpy启动服务;修改Prometheus配置;
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import logging
|
||||
import time
|
||||
from contextlib import contextmanager
|
||||
from typing import Optional
|
||||
|
||||
import psycopg
|
||||
from psycopg_pool import ConnectionPool
|
||||
|
||||
logger = logging.getLogger("PGPool")
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
|
||||
class PGPool:
|
||||
"""
|
||||
PostgreSQL 连接池封装
|
||||
@@ -62,8 +63,10 @@ class PGPool:
|
||||
logger.error(f"SQL执行异常: {e}")
|
||||
raise
|
||||
raise psycopg.OperationalError("无法获取数据库连接,多次重试失败")
|
||||
|
||||
|
||||
pg_pool = PGPool(
|
||||
uri="postgresql://postgres:123456@10.10.10.9/ktor2",
|
||||
uri="postgresql://postgres:123456@ce_postgres/ktor2",
|
||||
min_size=1,
|
||||
max_size=20,
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user