summaryrefslogtreecommitdiff
path: root/src/routes.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes.js')
-rwxr-xr-xsrc/routes.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/routes.js b/src/routes.js
index ab12a3a..8ea7e05 100755
--- a/src/routes.js
+++ b/src/routes.js
@@ -82,7 +82,13 @@ router.use(fileUpload());
// SCHEDULED DELETION
schedule.scheduleJob("59 23 * * *", function (fireDate) {
- const too_old = moment.tz("Etc/UTC").subtract(7, "days").toDate();
+ const deleteAfterDays = config.general.delete_after_days;
+ if (!deleteAfterDays || deleteAfterDays <= 0) {
+ // Deletion is disabled
+ return;
+ }
+
+ const too_old = moment.tz("Etc/UTC").subtract(deleteAfterDays, "days").toDate();
console.log(
"Old event deletion running! Deleting all events concluding before ",
too_old,