Skip to content

Commit

Permalink
fix transaction colosure
Browse files Browse the repository at this point in the history
  • Loading branch information
tanner0101 committed Apr 17, 2017
1 parent a68b676 commit 59e65ea
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/MySQLDriver/MySQLDriver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,10 @@ extension Driver: Transactable {
/// complex threading.
public func transaction<R>(_ closure: (Fluent.Connection) throws -> R) throws -> R {
let conn = try master.makeConnection()
var r: R!
try conn.transaction {
return try conn.transaction {
let wrapped = MySQLDriver.Connection(conn)
wrapped.queryLogger = self.queryLogger
r = try closure(wrapped)
return try closure(wrapped)
}
return r
}
}

0 comments on commit 59e65ea

Please sign in to comment.