add notification cleanup script

This commit is contained in:
2025-03-12 17:27:42 +05:30
parent 291aea90f0
commit 8456f04e15
2 changed files with 26 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
import mongoose from "mongoose";
import { setTimeout } from "timers/promises";
const permitsModel = mongoose.model(
"permit",
@@ -181,7 +180,4 @@ const processedModel = mongoose.model(
console.log(`${count} permits archived`);
await mongoose.connection.close();
console.log("Archiving complete. Going to sleep...");
await setTimeout(3600 * 25 * 1000);
})().catch((err) => console.log(err));