fix: admin auth UX, password policy, deps, db pool

This commit is contained in:
2025-12-17 23:53:11 +08:00
parent 9028f7e272
commit 5851120f87
6 changed files with 46 additions and 18 deletions

View File

@@ -111,6 +111,7 @@ class ConnectionPool:
if self._pool.qsize() < self.pool_size:
try:
new_conn = self._create_connection()
self._created_connections += 1
self._pool.put(new_conn, block=False)
except Full:
# 在获取锁期间池被填满了,关闭新建的连接
@@ -170,6 +171,7 @@ class PooledConnection:
if self._cursor:
self._cursor.close()
self._cursor = None
except Exception as e:
print(f"关闭游标失败: {e}")
finally:
@@ -180,7 +182,8 @@ class PooledConnection:
def cursor(self):
"""获取游标"""
self._cursor = self._conn.cursor()
if self._cursor is None:
self._cursor = self._conn.cursor()
return self._cursor
def commit(self):