1
This commit is contained in:
parent
1333e005d3
commit
717e9616ae
24
dbpool.go
24
dbpool.go
@ -405,7 +405,7 @@ func (this *dbPool) borrowConn(name string) *dataSource {
|
||||
if head, ok := this.dataSourceHash[name]; ok {
|
||||
if !head.Empty() {
|
||||
ds := head.FirstEntry().(*dataSource)
|
||||
ds.entry.DelInit()
|
||||
//ds.entry.DelInit()
|
||||
this.lock.Unlock()
|
||||
return ds
|
||||
}
|
||||
@ -416,17 +416,37 @@ func (this *dbPool) borrowConn(name string) *dataSource {
|
||||
tryCount++
|
||||
}
|
||||
return nil
|
||||
/*
|
||||
tryCount := 0
|
||||
for tryCount < 5 {
|
||||
{
|
||||
this.lock.Lock()
|
||||
if head, ok := this.dataSourceHash[name]; ok {
|
||||
if !head.Empty() {
|
||||
ds := head.FirstEntry().(*dataSource)
|
||||
ds.entry.DelInit()
|
||||
this.lock.Unlock()
|
||||
return ds
|
||||
}
|
||||
}
|
||||
this.lock.Unlock()
|
||||
}
|
||||
time.Sleep(time.Second * 1)
|
||||
tryCount++
|
||||
}
|
||||
return nil*/
|
||||
}
|
||||
|
||||
func (this *dbPool) returnConn(ds *dataSource) {
|
||||
this.lock.Lock()
|
||||
defer this.lock.Unlock()
|
||||
|
||||
/*
|
||||
if head, ok := this.dataSourceHash[ds.name]; ok {
|
||||
head.AddTail(&ds.entry)
|
||||
} else {
|
||||
panic(fmt.Sprintf("returnConn error %s", ds.name))
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
func (this *dbPool) joinSelectFields(fields []string) string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user