Skip to content

Commit

Permalink
delete temporary files
Browse files Browse the repository at this point in the history
  • Loading branch information
sdobbert committed Feb 29, 2024
1 parent 429e6f1 commit d4d2547
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/create-contour/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ const contourLinesWorker = async (workerJob, inputs) => {
if (client) {
await client.end();
}
// delete temporary files
const filesToDelete = fs.readdirSync('/tmp/')
for (const file of filesToDelete) {

await fs.unlink(file, (err => {
if (err) logger.error(err);
else {
logger.info('Deleted file:', file)
}
}));
}
}

workerJob.status = 'success';
Expand Down

0 comments on commit d4d2547

Please sign in to comment.