diff --git a/lib/methods/export.js b/lib/methods/export.js index d4e683b9..d4b85979 100644 --- a/lib/methods/export.js +++ b/lib/methods/export.js @@ -370,15 +370,22 @@ module.exports = self => { // Report is available for 10 minutes by default removeFromUploadFs(downloadPath, expiration) { const ms = expiration || 1000 * 60 * 10; - console.info(`[export] removing ${self.apos.rootDir}/public/uploads${downloadPath} from uploadfs in ${ms / 1000 / 60} minutes`); - setTimeout(() => { + const remove = () => { console.info(`[export] removing ${self.apos.rootDir}/public/uploads${downloadPath} from uploadfs`); self.apos.attachment.uploadfs.remove(downloadPath, error => { if (error) { self.apos.util.error(error); } }); - }, ms); + }; + + if (process.env.CI) { + remove(); + return; + } + + console.info(`[export] removing ${self.apos.rootDir}/public/uploads${downloadPath} from uploadfs in ${ms / 1000 / 60} minutes`); + setTimeout(remove, ms); } }; };