fix: app raises port not available error (#2466)
This commit is contained in:
parent
254a79ccbe
commit
3c0383f6d8
@ -84,7 +84,7 @@ function unloadModel(): Promise<any> {
|
|||||||
debugLog(
|
debugLog(
|
||||||
`Could not kill running process on port ${ENGINE_PORT}. Might be another process running on the same port? ${err}`
|
`Could not kill running process on port ${ENGINE_PORT}. Might be another process running on the same port? ${err}`
|
||||||
)
|
)
|
||||||
throw 'PORT_NOT_AVAILABLE'
|
return { err: 'PORT_NOT_AVAILABLE' }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -97,6 +97,11 @@ async function runEngineAndLoadModel(
|
|||||||
systemInfo: SystemInformation
|
systemInfo: SystemInformation
|
||||||
) {
|
) {
|
||||||
return unloadModel()
|
return unloadModel()
|
||||||
|
.then((res) => {
|
||||||
|
if (res?.error) {
|
||||||
|
throw new Error(res.error)
|
||||||
|
}
|
||||||
|
})
|
||||||
.then(() => runEngine(systemInfo))
|
.then(() => runEngine(systemInfo))
|
||||||
.then(() => loadModelRequest(settings))
|
.then(() => loadModelRequest(settings))
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user