优化连接池

This commit is contained in:
2026-04-20 11:16:59 +08:00
parent 8a61b56389
commit bd1ddfb0e7
4 changed files with 30 additions and 13 deletions
+10 -4
View File
@@ -138,13 +138,19 @@ namespace WebAPI.Filter
}
if (!isOk)
{
if (BLL.Funs.DBList.ContainsKey(System.Threading.Thread.CurrentThread.ManagedThreadId))
{
BLL.Funs.DBList.Remove(System.Threading.Thread.CurrentThread.ManagedThreadId);
}
base.OnActionExecuted(actionExecutedContext);
}
if (BLL.Funs.DBList.ContainsKey(System.Threading.Thread.CurrentThread.ManagedThreadId))
{
Model.SGGLDB db;
BLL.Funs.DBList.TryRemove(System.Threading.Thread.CurrentThread.ManagedThreadId, out db);
if (db != null)
{
db.Dispose();
}
}
}
/// <summary>