fix: admin auth UX, password policy, deps, db pool
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user