manual transaction handling for jobs

This commit is contained in:
azivner
2018-02-24 22:44:45 -05:00
parent f0bea9cf71
commit 12c06ae97e
4 changed files with 37 additions and 18 deletions

View File

@@ -195,6 +195,7 @@ async function doInTransaction(func) {
await transactionPromise;
}
let ret = null;
const error = new Error(); // to capture correct stack trace in case of exception
transactionActive = true;
@@ -202,7 +203,7 @@ async function doInTransaction(func) {
try {
await beginTransaction();
await func();
ret = await func();
await commit();
@@ -223,6 +224,8 @@ async function doInTransaction(func) {
if (transactionActive) {
await transactionPromise;
}
return ret;
}
async function isDbUpToDate() {