Skip to content

Commit

Permalink
Adjust storage cleanup cronjob
Browse files Browse the repository at this point in the history
  • Loading branch information
yduman committed Jun 14, 2020
1 parent 8004d50 commit 7f714fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/src/storageCleanUp.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const chalk = require("chalk");
const findRemoveSync = require("find-remove");

// delete all files older than one week or one day
const WEEKLY_THRESHOLD = 604800;
const DAILY_THRESHOLD = 86400;
const THRESHOLD = process.env.RETRO_PUBLIC ? DAILY_THRESHOLD : WEEKLY_THRESHOLD;
const REGULAR_THRESHOLD = 604800; // one week
const PUBLIC_THRESHOLD = 21600; // six hours
const THRESHOLD = process.env.RETRO_PUBLIC
? PUBLIC_THRESHOLD
: REGULAR_THRESHOLD;

const clean = (storagePath) => {
const jsonResult = findRemoveSync(storagePath, {
Expand Down

0 comments on commit 7f714fc

Please sign in to comment.