fix: 4155 - Queue up health check on server restarting
This commit is contained in:
parent
d9313d670a
commit
fb0a916c50
@ -334,13 +334,22 @@ export default class JanInferenceCortexExtension extends LocalOAIEngine {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is to handle the server segfault issue
|
||||||
|
*/
|
||||||
this.socket.onclose = (event) => {
|
this.socket.onclose = (event) => {
|
||||||
console.log('WebSocket closed:', event)
|
console.log('WebSocket closed:', event)
|
||||||
|
// Notify app to update model running state
|
||||||
events.emit(ModelEvent.OnModelStopped, {})
|
events.emit(ModelEvent.OnModelStopped, {})
|
||||||
|
|
||||||
|
// Reconnect to the /events websocket
|
||||||
if (this.shouldReconnect) {
|
if (this.shouldReconnect) {
|
||||||
console.log(`Attempting to reconnect...`)
|
console.log(`Attempting to reconnect...`)
|
||||||
setTimeout(() => this.subscribeToEvents(), 1000)
|
setTimeout(() => this.subscribeToEvents(), 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Queue up health check
|
||||||
|
this.queue.add(() => this.healthz())
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user