implement "/info"

This commit is contained in:
NekoMonci12
2025-06-04 09:00:36 +07:00
parent 22211e5987
commit 95fcd3e5dc
4 changed files with 125 additions and 3 deletions

View File

@@ -104,6 +104,19 @@ class MongoCacheManager {
{ upsert: true }
);
}
// Add this function at the bottom of your main file (index.js)
async getMongoCacheCount() {
try {
await this.connect(); // Ensure connection
const count = await this.collection.countDocuments();
console.log(`Total cache entries in MongoDB: ${count}`);
return count;
} catch (err) {
console.error('Error counting cache documents:', err);
return null;
}
}
}
module.exports = MongoCacheManager;