File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,7 @@ private function pop(): \Generator {
110
110
}
111
111
112
112
while ($ this ->promise !== null && $ this ->connections ->count () + $ this ->pending >= $ this ->getMaxConnections ()) {
113
- try {
114
- yield $ this ->promise ; // Prevent simultaneous connection creation when connection count is at maximum - 1.
115
- } catch (\Throwable $ exception ) {
116
- // Ignore failure or cancellation of other operations.
117
- }
113
+ yield $ this ->promise ; // Prevent simultaneous connection creation when connection count is at maximum - 1.
118
114
}
119
115
120
116
while ($ this ->idle ->isEmpty ()) { // While loop to ensure an idle connection is available after promises below are resolved.
@@ -125,20 +121,15 @@ private function pop(): \Generator {
125
121
yield $ this ->promise = $ this ->deferred ->promise (); // May be resolved with defunct connection.
126
122
} finally {
127
123
$ this ->deferred = null ;
128
- if ($ this ->pending === 0 ) {
129
- $ this ->promise = null ;
130
- }
124
+ $ this ->promise = null ;
131
125
}
132
126
} else {
133
127
// Max connection count has not been reached, so open another connection.
134
128
++$ this ->pending ;
135
129
try {
136
- $ this ->promise = $ this ->createConnection ();
137
- $ connection = yield $ this ->promise ;
130
+ $ connection = yield $ this ->createConnection ();
138
131
} finally {
139
- if (--$ this ->pending === 0 ) {
140
- $ this ->promise = null ;
141
- }
132
+ --$ this ->pending ;
142
133
}
143
134
144
135
$ this ->connections ->attach ($ connection );
You can’t perform that action at this time.
0 commit comments