fix: watch all events to load keys

This commit is contained in:
Eli Bosley
2025-01-28 16:05:40 -05:00
parent 76711be3e8
commit ff63535b00

View File

@@ -47,7 +47,7 @@ export class ApiKeyService implements OnModuleInit {
} }
private setupWatch() { private setupWatch() {
watch(this.basePath, { ignoreInitial: false }).on('change', async (path) => { watch(this.basePath, { ignoreInitial: false }).on('all', async (path) => {
this.logger.debug(`API key changed: ${path}`); this.logger.debug(`API key changed: ${path}`);
this.memoryApiKeys = []; this.memoryApiKeys = [];
this.memoryApiKeys = await this.loadAllFromDisk(); this.memoryApiKeys = await this.loadAllFromDisk();