File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,23 +51,7 @@ final class _MySQLBridge: Bridgeable {
5151 func connection< T> ( to db: DatabaseIdentifier ,
5252 on eventLoop: EventLoop ,
5353 _ closure: @escaping ( MySQLConnection ) -> EventLoopFuture < T > ) -> EventLoopFuture < T > {
54- self . db ( db, on: eventLoop) . withConnection { conn in
55- closure ( conn) . flatMap { result in
56- if conn. isClosed {
57- return conn. eventLoop. future ( result)
58- } else {
59- return conn. close ( ) . transform ( to: result)
60- }
61- } . flatMapError { error in
62- if conn. isClosed {
63- return conn. close ( ) . flatMapThrowing {
64- throw error
65- }
66- } else {
67- return conn. eventLoop. makeFailedFuture ( error)
68- }
69- }
70- }
54+ self . db ( db, on: eventLoop) . withConnection { closure ( $0) }
7155 }
7256
7357 func db( _ db: DatabaseIdentifier , on eventLoop: EventLoop ) -> MySQLDatabase {
You can’t perform that action at this time.
0 commit comments