mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-10 15:57:04 +00:00
app: do not restart the server if app is closing
This commit is contained in:
@@ -95,10 +95,12 @@ function server() {
|
|||||||
logger.error(data.toString().trim())
|
logger.error(data.toString().trim())
|
||||||
})
|
})
|
||||||
|
|
||||||
proc.on('exit', () => {
|
function restart() {
|
||||||
logger.info('Restarting the server...')
|
logger.info('Restarting the server...')
|
||||||
server()
|
server()
|
||||||
})
|
}
|
||||||
|
|
||||||
|
proc.on('exit', restart)
|
||||||
|
|
||||||
proc.on('disconnect', () => {
|
proc.on('disconnect', () => {
|
||||||
logger.info('Server disconnected. Reconnecting...')
|
logger.info('Server disconnected. Reconnecting...')
|
||||||
@@ -106,6 +108,7 @@ function server() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
process.on('exit', () => {
|
process.on('exit', () => {
|
||||||
|
proc.off('exit', restart)
|
||||||
proc.kill()
|
proc.kill()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user