Skip to content

Commit cdfe779

Browse files
Honor pool connection timeout when executing queries directly in the pool.
Should fix #1232, as it now uses the timeout when acquiring the connection
1 parent 6e399a2 commit cdfe779

File tree

1 file changed

+3
-1
lines changed
  • vertx-sql-client/src/main/java/io/vertx/sqlclient/impl

1 file changed

+3
-1
lines changed

vertx-sql-client/src/main/java/io/vertx/sqlclient/impl/PoolImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,9 @@ public Future<SqlConnection> getConnection() {
169169

170170
@Override
171171
public <R> Future<R> schedule(ContextInternal context, CommandBase<R> cmd) {
172-
return pool.execute(context, cmd);
172+
PromiseInternal<SqlConnectionPool.PooledConnection> promise = context.promise();
173+
acquire(context, connectionTimeout, promise);
174+
return promise.future().compose((pooled -> pooled.schedule(context, cmd)));
173175
}
174176

175177
private void acquire(ContextInternal context, long timeout, Handler<AsyncResult<SqlConnectionPool.PooledConnection>> completionHandler) {

0 commit comments

Comments
 (0)