Created
February 13, 2017 17:32
-
-
Save slaykovsky/f0550dafa7312af85ebe2b048f219d4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.route("/api/testRuns*").handler(ctx -> client.getConnection(res -> { | |
if (res.failed()) { | |
ctx.fail(res.cause()); | |
} else { | |
SQLConnection conn = res.result(); | |
ctx.put("conn", conn); | |
ctx.addHeadersEndHandler(done -> conn.close(close -> { | |
})); | |
ctx.next(); | |
} | |
})).failureHandler(ctx -> { | |
SQLConnection conn = ctx.get("conn"); | |
if (conn != null) { | |
conn.close(close -> { | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment