Bläddra i källkod

Merge pull request #377 from Zariel/policy-pool-sync-fill

When initially filling the host pool do it sync.
Ben Hood 10 år sedan
förälder
incheckning
08128431dc
1 ändrade filer med 12 tillägg och 0 borttagningar
  1. 12 0
      connectionpool.go

+ 12 - 0
connectionpool.go

@@ -762,6 +762,18 @@ func (pool *hostConnPool) fill() {
 
 		// filled one
 		fillCount--
+
+		// connect all connections to this host in sync
+		for fillCount > 0 {
+			err := pool.connect()
+			pool.logConnectErr(err)
+
+			// decrement, even on error
+			fillCount--
+		}
+
+		go pool.fillingStopped()
+		return
 	}
 
 	// fill the rest of the pool asynchronously