Skip to content

Commit

Permalink
optional onDone
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofbyteball committed Jul 15, 2018
1 parent 46b675c commit bbd1394
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db.js
Expand Up @@ -28,7 +28,8 @@ function executeInTransaction(doWork, onDone){
doWork(conn, function(err){
conn.query(err ? "ROLLBACK" : "COMMIT", function(){
conn.release();
onDone(err);
if (onDone)
onDone(err);
});
});
});
Expand Down

0 comments on commit bbd1394

Please sign in to comment.