Skip to content

Commit

Permalink
Merge pull request #247 from klips-project/delete-tmp
Browse files Browse the repository at this point in the history
Delete temporary files after writing to database
  • Loading branch information
FritzHoing authored Feb 29, 2024
2 parents 429e6f1 + d4d2547 commit 64a3ce8
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 64a3ce8

Please sign in to comment.