mirror of
https://github.com/mudler/LocalAI.git
synced 2026-04-22 18:18:42 -05:00
fix(model-loading): keep track of open GRPC Clients (#3377)
Due to a previous refactor we moved the client constructor tight to the model address, however that was just a string which we would use to build the client each time. With this change we make the loader to return a *Model which carries a constructor for the client and stores the client on the first connection. Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
committed by
GitHub
parent
771a052480
commit
7f06954425
@@ -33,7 +33,7 @@ func (ml *ModelLoader) StopAllExcept(s string) error {
|
||||
func (ml *ModelLoader) deleteProcess(s string) error {
|
||||
if _, exists := ml.grpcProcesses[s]; exists {
|
||||
if err := ml.grpcProcesses[s].Stop(); err != nil {
|
||||
return err
|
||||
log.Error().Err(err).Msgf("(deleteProcess) error while deleting grpc process %s", s)
|
||||
}
|
||||
}
|
||||
delete(ml.grpcProcesses, s)
|
||||
|
||||
Reference in New Issue
Block a user