(key: string, sessionId: string)
| 29 | } |
| 30 | |
| 31 | async set(key: string, sessionId: string): Promise<void> { |
| 32 | await this.load(); |
| 33 | this.map[key] = sessionId; |
| 34 | await fs.mkdir(path.dirname(this.file), { recursive: true }).catch(() => {}); |
| 35 | await fs.writeFile(this.file, JSON.stringify(this.map, null, 2)).catch(() => {}); |
| 36 | } |
| 37 | |
| 38 | async clear(key: string): Promise<void> { |
| 39 | await this.load(); |