修复数据库连接指针问题

This commit is contained in:
junleea 2025-10-03 21:13:02 +08:00
parent 63ea13bbde
commit 4bc256aba4
1 changed files with 2 additions and 2 deletions

View File

@ -240,11 +240,11 @@ func GetDBTableDesc(req *proto.GetDBTableDescReq, userId int) (*proto.SQLResult,
func DelDBMMap() { func DelDBMMap() {
dao.DBMMapRWMutex.Lock() dao.DBMMapRWMutex.Lock()
defer dao.DBMMapRWMutex.Unlock()
cur := worker.GetCurrentTimestamp() cur := worker.GetCurrentTimestamp()
for k, v := range dao.DBMMap { for k, v := range dao.DBMMap {
if cur-v.LastUserTime < proto.DBMMap_Max_Keep_Time { if (cur - v.LastUserTime) > proto.DBMMap_Max_Keep_Time {
delete(dao.DBMMap, k) //删除 delete(dao.DBMMap, k) //删除
} }
} }
dao.DBMMapRWMutex.Unlock()
} }