close llm on interrupt (#577)
This commit is contained in:
parent
9df31c3518
commit
5d71bda478
@ -570,6 +570,9 @@ func Serve(ln net.Listener, allowOrigins []string) error {
|
|||||||
signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
|
signal.Notify(signals, syscall.SIGINT, syscall.SIGTERM)
|
||||||
go func() {
|
go func() {
|
||||||
<-signals
|
<-signals
|
||||||
|
if loaded.llm != nil {
|
||||||
|
loaded.llm.Close()
|
||||||
|
}
|
||||||
os.RemoveAll(workDir)
|
os.RemoveAll(workDir)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}()
|
}()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user