Skip to content

Commit

Permalink
make sure to await cleanup (no longer returns a promise)
Browse files Browse the repository at this point in the history
  • Loading branch information
nvdk committed Jan 11, 2020
1 parent 94fba51 commit e5ad8b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions repository/fill-intern-overheid.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ export const fillUp = async (queryEnv, agendas) => {
await runStage('copy temp to target', queryEnv, () => {
return copyTempToTarget(queryEnv);
});
await runStage('done filling overheid', queryEnv, () => {
return cleanup(queryEnv);
});
await runStage('done filling overheid', queryEnv, cleanup);
const end = moment().utc();
logStage(start,`fill overheid ended at: ${end.format()}`, targetGraph);
} catch (e) {
logStage(moment(), `${e}\n${e.stack}`, queryEnv.targetGraph);
try {
cleanup(queryEnv);
await cleanup(queryEnv);
}catch (e2) {
console.log(e2);
}
Expand Down
8 changes: 3 additions & 5 deletions repository/fill-intern-regering.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,15 @@ export const fillUp = async (queryEnv, agendas) => {
await runStage('copy temp to target', queryEnv, () => {
return copyTempToTarget(queryEnv);
});
await runStage('cleaned up', queryEnv, () => {
return cleanup(queryEnv);
});
await runStage('cleaned up', queryEnv, cleanup);
const end = moment().utc();
logStage(start, `fill regering ended at: ${end.format()}`, targetGraph);
}catch (e) {
logStage(moment(), `${e}\n${e.stack}`, queryEnv.targetGraph);
try {
cleanup(queryEnv);
await cleanup(queryEnv);
}catch (e2) {
console.log(e2);
}
}
};
};

0 comments on commit e5ad8b3

Please sign in to comment.