mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-28 06:25:00 +00: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:
parent
771a052480
commit
7f06954425
10 changed files with 176 additions and 171 deletions
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
// WatchDog tracks all the requests from GRPC clients.
|
||||
// All GRPC Clients created by ModelLoader should have an associated injected
|
||||
// watchdog that will keep track of the state of each backend (busy or not)
|
||||
// and for how much time it has been busy.
|
||||
|
@ -15,7 +16,6 @@ import (
|
|||
// force a reload of the model
|
||||
// The watchdog runs as a separate go routine,
|
||||
// and the GRPC client talks to it via a channel to send status updates
|
||||
|
||||
type WatchDog struct {
|
||||
sync.Mutex
|
||||
timetable map[string]time.Time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue