Merge pull request #4131 from janhq/fix/4012-active-model-stopped-on-process-exit
fix: 4012 - active model should be gone as soon as cortex.cpp server is killed
This commit is contained in:
commit
15588fa82a
@ -70,7 +70,7 @@ export default class JanInferenceCortexExtension extends LocalOAIEngine {
|
|||||||
super.onLoad()
|
super.onLoad()
|
||||||
|
|
||||||
this.queue.add(() => this.clean())
|
this.queue.add(() => this.clean())
|
||||||
|
|
||||||
// Run the process watchdog
|
// Run the process watchdog
|
||||||
const systemInfo = await systemInformation()
|
const systemInfo = await systemInformation()
|
||||||
this.queue.add(() => executeOnMain(NODE, 'run', systemInfo))
|
this.queue.add(() => executeOnMain(NODE, 'run', systemInfo))
|
||||||
@ -251,6 +251,7 @@ export default class JanInferenceCortexExtension extends LocalOAIEngine {
|
|||||||
|
|
||||||
this.socket.onclose = (event) => {
|
this.socket.onclose = (event) => {
|
||||||
console.log('WebSocket closed:', event)
|
console.log('WebSocket closed:', event)
|
||||||
|
events.emit(ModelEvent.OnModelStopped, {})
|
||||||
if (this.shouldReconnect) {
|
if (this.shouldReconnect) {
|
||||||
console.log(`Attempting to reconnect...`)
|
console.log(`Attempting to reconnect...`)
|
||||||
setTimeout(() => this.subscribeToEvents(), 1000)
|
setTimeout(() => this.subscribeToEvents(), 1000)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user