mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00
chore(refactor): drop duplicated shutdown logics (#3589)
* chore(refactor): drop duplicated shutdown logics - Handle locking in Shutdown and CheckModelIsLoaded in a more go-idiomatic way - Drop duplicated code and re-organize shutdown code Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * fix: drop leftover Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * chore: improve logging and add missing locks Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
eee1fb2c75
commit
a53392f919
5 changed files with 32 additions and 38 deletions
17
pkg/model/filters.go
Normal file
17
pkg/model/filters.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
process "github.com/mudler/go-processmanager"
|
||||
)
|
||||
|
||||
type GRPCProcessFilter = func(id string, p *process.Process) bool
|
||||
|
||||
func all(_ string, _ *process.Process) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func allExcept(s string) GRPCProcessFilter {
|
||||
return func(id string, p *process.Process) bool {
|
||||
return id != s
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue