()
| 379 | } |
| 380 | await this.cache.saveData({ |
| 381 | daily_history: historyObj, |
| 382 | last_day_check: this.lastDayCheck |
| 383 | }); |
| 384 | } |
| 385 | |
| 386 | private static maintenance(now: number) { |
| 387 | // 每分钟清理一次过期消息 |
| 388 | if (now - this.lastCleanup > 60) { |
| 389 | for (const [gid, msgs] of this.recentMessages) { |
| 390 | const valid = msgs.filter(m => now - m.time <= this.triggerConfig.timeWindow); |
| 391 | if (valid.length === 0) { |
| 392 | this.recentMessages.delete(gid); |
| 393 | } else { |
no test coverage detected