diff --git a/src/create-contour/index.js b/src/create-contour/index.js index e66695e..70d0518 100644 --- a/src/create-contour/index.js +++ b/src/create-contour/index.js @@ -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';