mirror of
https://github.com/NekoMonci12/RakunNakun-AI.git
synced 2025-12-19 23:09:15 +00:00
implement "/info"
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user