File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/pool Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,14 @@ public void init(Holder holder) {
169
169
170
170
@ Override
171
171
public void close (Holder holder , Promise <Void > promise ) {
172
+ if (context != null ) {
173
+ context .dispatch (v -> doClose (holder , promise ));
174
+ } else {
175
+ doClose (holder , promise );
176
+ }
177
+ }
178
+
179
+ private void doClose (Holder holder , Promise <Void > promise ) {
172
180
if (holder != this .holder ) {
173
181
String msg ;
174
182
if (this .holder == null ) {
@@ -242,10 +250,6 @@ private void check() {
242
250
while (waiters .size () > 0 ) {
243
251
if (available .size () > 0 ) {
244
252
PooledConnection proxy = available .poll ();
245
- if (proxy == null ) {
246
- // available is empty?
247
- return ;
248
- }
249
253
Handler <AsyncResult <Connection >> waiter = waiters .poll ();
250
254
waiter .handle (Future .succeededFuture (proxy ));
251
255
} else {
You can’t perform that action at this time.
0 commit comments