From 0b3847a8b150332ee5d8a5aeeec86c06c43cf500 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 19 Nov 2024 23:38:06 +0700 Subject: [PATCH] chore: ensure server is started before letting other requests go thru --- extensions/inference-cortex-extension/src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extensions/inference-cortex-extension/src/index.ts b/extensions/inference-cortex-extension/src/index.ts index 8236d7de4..98e2d0dd5 100644 --- a/extensions/inference-cortex-extension/src/index.ts +++ b/extensions/inference-cortex-extension/src/index.ts @@ -69,12 +69,13 @@ export default class JanInferenceCortexExtension extends LocalOAIEngine { super.onLoad() - await this.queue.add(() => this.clean()) - this.queue.add(() => this.healthz()) - this.queue.add(() => this.setDefaultEngine(systemInfo)) + this.queue.add(() => this.clean()) + // Run the process watchdog const systemInfo = await systemInformation() - await executeOnMain(NODE, 'run', systemInfo) + this.queue.add(() => executeOnMain(NODE, 'run', systemInfo)) + this.queue.add(() => this.healthz()) + this.queue.add(() => this.setDefaultEngine(systemInfo)) this.subscribeToEvents() window.addEventListener('beforeunload', () => {