From 2f163d610ee5116fae08997d17a3e339b7f01ecc Mon Sep 17 00:00:00 2001 From: Miles Wells Date: Fri, 12 Aug 2022 18:27:37 +0300 Subject: [PATCH] Restore await --- lib.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.js b/lib.js index a5e81bc..0da117c 100644 --- a/lib.js +++ b/lib.js @@ -248,7 +248,7 @@ async function shortCircuit(job, func = null) { // If lazy, load records to check whether we already have the results saved if (job.data.force === false) { // NB: Strict equality; force by default _log('Updating job data directly from record for job #%g', job.id); - if (updateJobFromRecord(job)) return job.done(); // No need to run tests; skip to complete routine + if (await updateJobFromRecord(job)) return job.done(); // No need to run tests; skip to complete routine } // Go ahead and prepare to run tests @@ -531,7 +531,7 @@ async function buildRoutine(job) { async function updateJob(proc) { debug('Job routine complete'); // Attempt to update the job data from the JSON records, throw error if this fails - if (!updateJobFromRecord(job)) { + if (!await updateJobFromRecord(job)) { job.done(new Error('Failed to return test result')); } else { job.done(); // All good