Skip to content

Commit

Permalink
fix(app): ignore error throw on closure if temp folder already removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed May 31, 2022
1 parent 85fcd2f commit a28db7e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ const main = async () => {
process.once(signal, async () => {
server.log.info({ signal }, "Closing application");
try {
await fs.rm(config.poppler.tempDirectory, {
recursive: true,
});
await fs
.rm(config.poppler.tempDirectory, {
recursive: true,
})
.catch((err) => {
// Ignore "ENOENT: no such file or directory" error
/* istanbul ignore if */
if (err.code !== "ENOENT") {
throw err;
}
});
await server.close();
server.log.info({ signal }, "Application closed");
process.exit(0);
Expand Down

0 comments on commit a28db7e

Please sign in to comment.