perf: schema indexes (#3446)

This commit is contained in:
Archer
2024-12-21 00:01:14 +08:00
committed by GitHub
parent b48eff4212
commit e5b8dea9ae
3 changed files with 11 additions and 3 deletions

View File

@@ -65,7 +65,7 @@ try {
// timer task. clear dead team
// UsageSchema.index({ teamId: 1, time: -1 }, { background: true });
UsageSchema.index({ time: 1 }, { expireAfterSeconds: 180 * 24 * 60 * 60 });
UsageSchema.index({ time: 1 }, { background: true, expireAfterSeconds: 720 * 24 * 60 * 60 });
} catch (error) {
console.log(error);
}