Vedavyas1235 commited on
Commit
5e19eaa
·
1 Parent(s): f559b41

Revert download cleanup delay

Browse files
Files changed (1) hide show
  1. index.js +5 -7
index.js CHANGED
@@ -409,13 +409,11 @@ app.get('/api/download/:jobId', (req, res) => { // Removed requireAuth for easy
409
  }
410
 
411
  res.download(job.outputPath, 'render.mp4', () => {
412
- // Delay cleanup by 5 minutes to allow re-downloads if the connection drops
413
- setTimeout(() => {
414
- jobs.delete(job.id);
415
- if (job.tempDir) {
416
- try { fs.rmSync(job.tempDir, { recursive: true, force: true }); } catch (e) {}
417
- }
418
- }, 5 * 60 * 1000);
419
  });
420
  });
421
 
 
409
  }
410
 
411
  res.download(job.outputPath, 'render.mp4', () => {
412
+ // Cleanup after download
413
+ jobs.delete(job.id);
414
+ if (job.tempDir) {
415
+ try { fs.rmSync(job.tempDir, { recursive: true, force: true }); } catch (e) {}
416
+ }
 
 
417
  });
418
  });
419