mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-27 14:05:00 +00:00
fix(initializer): correctly reap dangling processes (#3717)
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
e5586e8781
commit
4686877c6d
3 changed files with 14 additions and 4 deletions
|
@ -18,14 +18,18 @@ import (
|
|||
func (ml *ModelLoader) deleteProcess(s string) error {
|
||||
defer delete(ml.models, s)
|
||||
|
||||
log.Debug().Msgf("Deleting process %s", s)
|
||||
|
||||
m, exists := ml.models[s]
|
||||
if !exists {
|
||||
log.Error().Msgf("Model does not exist %s", s)
|
||||
// Nothing to do
|
||||
return nil
|
||||
}
|
||||
|
||||
process := m.Process()
|
||||
if process == nil {
|
||||
log.Error().Msgf("No process for %s", s)
|
||||
// Nothing to do as there is no process
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue