fix: 4012 - active model should be gone as soon as cortex.cpp server is killed

This commit is contained in:
Louis 2024-11-26 19:03:26 +07:00
parent 79287d5748
commit 638dbf178e
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -70,7 +70,7 @@ export default class JanInferenceCortexExtension extends LocalOAIEngine {
super.onLoad()
this.queue.add(() => this.clean())
// Run the process watchdog
const systemInfo = await systemInformation()
this.queue.add(() => executeOnMain(NODE, 'run', systemInfo))
@ -251,6 +251,7 @@ export default class JanInferenceCortexExtension extends LocalOAIEngine {
this.socket.onclose = (event) => {
console.log('WebSocket closed:', event)
events.emit(ModelEvent.OnModelStopped, {})
if (this.shouldReconnect) {
console.log(`Attempting to reconnect...`)
setTimeout(() => this.subscribeToEvents(), 1000)