mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-10 15:57:04 +00:00
close llm on interrupt (#577)
This commit is contained in:
@@ -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)
|
||||||
}()
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user