Parcourir la source

Merge pull request #381 from Zariel/async-fill-empty-host-pool

When the hostpool is empty dont block in fill
Ben Hood il y a 10 ans
Parent
commit
21d3ca5443
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      connectionpool.go

+ 2 - 1
connectionpool.go

@@ -679,7 +679,8 @@ func (pool *hostConnPool) Pick(qry *Query) *Conn {
 
 	if empty {
 		// try to fill the empty pool
-		pool.fill()
+		go pool.fill()
+		return nil
 	}
 
 	return pool.policy.Pick(qry)