()
| 231 | |
| 232 | static async getAllEnabledUsers(): Promise<number[]> { |
| 233 | await this.init(); |
| 234 | const users = this.db?.data?.users ?? {}; |
| 235 | return Object.entries(users) |
| 236 | .filter(([_, v]) => v.is_enabled) |
| 237 | .map(([k]) => parseInt(k, 10)); |
| 238 | } |
| 239 | |
| 240 | static cleanup(): void { |
| 241 | // 引用重置:清空 db 和 initPromise,便于 reload 后重新初始化 |
| 242 | this.db = null; |
no test coverage detected