diff --git a/src/services/wasm-codes/wasm-code.service.ts b/src/services/wasm-codes/wasm-code.service.ts index 0fad4565..b2e07431 100644 --- a/src/services/wasm-codes/wasm-code.service.ts +++ b/src/services/wasm-codes/wasm-code.service.ts @@ -88,20 +88,23 @@ export class WasmCodeService implements WasmCodeAdapter { } async reloadWasmCodeIdsFromDB(): Promise { - const wasmCodesFromDB = await WasmCodeKey.findAllWithIds() - - const wasmCodes = wasmCodesFromDB.map( - (wasmCodeKey: WasmCodeKey) => - new WasmCode( - wasmCodeKey.codeKey, - wasmCodeKey.codeKeyIds.map( - (wasmCodeKeyId: WasmCodeKeyId) => wasmCodeKeyId.codeKeyId + try { + const wasmCodesFromDB = await WasmCodeKey.findAllWithIds() + + const wasmCodes = wasmCodesFromDB.map( + (wasmCodeKey: WasmCodeKey) => + new WasmCode( + wasmCodeKey.codeKey, + wasmCodeKey.codeKeyIds.map( + (wasmCodeKeyId: WasmCodeKeyId) => wasmCodeKeyId.codeKeyId + ) ) - ) - ) - - this.resetWasmCodes() - this.addWasmCodes(wasmCodes) + ) + this.resetWasmCodes() + this.addWasmCodes(wasmCodes) + } catch (error) { + console.error('Failed to reload wasm code ids from DB:', error) + } } startUpdater(): void {