()
| 139 | for (const [k, v] of Object.entries(this.configDb.data.surveillance)) this.sv.set(k, v as SvEntry); |
| 140 | // load cache from separate file — tolerate corrupt/truncated JSON |
| 141 | const cp = path.join(createDirectoryInAssets("fbi"), "cache.json"); |
| 142 | this.cachePath = cp; |
| 143 | try { |
| 144 | this.cacheDb = await JSONFilePreset<FbiCache>(cp, { cache: {} }); |
| 145 | if (this.cacheDb.data.cache) { |
| 146 | for (const [k, v] of Object.entries(this.cacheDb.data.cache)) |
| 147 | this.chatCache.set(k, v as CachedChat); |