diff --git a/cron/notificationCleanup.js b/cron/notificationCleanup.js index 4d56949..86df601 100644 --- a/cron/notificationCleanup.js +++ b/cron/notificationCleanup.js @@ -17,7 +17,7 @@ const notifModel = mongoose.model( await mongoose.connect(process.env.DB_URI); - const fifthDay = new Date(Date.now() - 3600 * 24 * 5 * 1000); + const fifthDay = new Date(Date.now() - 3600 * 24 * 15 * 1000); const result = await notifModel.deleteMany({ createdAt: { $lt: fifthDay } }); console.log(`Deleted ${result.deletedCount} notifications`); diff --git a/scripts/cron.sh b/scripts/cron.sh index 68fe405..5af6fc2 100644 --- a/scripts/cron.sh +++ b/scripts/cron.sh @@ -15,4 +15,5 @@ CRON_DIR="$WORKDIR/cron" cd "$WORKDIR" || { echo "Failed to change directory to $WORKDIR"; exit 1; } node --env-file=.env "$CRON_DIR/configUpdate.js" -node --env-file=.env "$CRON_DIR/analytics.js" \ No newline at end of file +node --env-file=.env "$CRON_DIR/analytics.js" +node --env-file=.env "$CRON_DIR/notificationCleanup.js" \ No newline at end of file