From 1a8c40f038fb9ca886b7adaf7f19df0bb78beddb Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 20 Aug 2023 18:41:07 +0800 Subject: [PATCH] 1 --- dbpool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbpool.go b/dbpool.go index e989032..74ceb62 100644 --- a/dbpool.go +++ b/dbpool.go @@ -99,7 +99,6 @@ func (this *dbPool) SelectOne( func (this *dbPool) OrmSelectOne( dataSource string, tblName string, - fields []string, whereKv [][]string, cb QueryOneCb) { params := []string{} @@ -193,14 +192,15 @@ func (this *dbPool) borrowConn(name string) *dataSource { for tryCount < 5 { { this.lock.Lock() - defer this.lock.Unlock() if head, ok := this.dataSourceHash[name]; ok { if !head.Empty() { next := head.Next() next.Del() + this.lock.Unlock() return next.GetData().(*dataSource) } } + this.lock.Unlock() } time.Sleep(time.Second * 1) tryCount++