clean up: remove server functions from client (#937)

This commit is contained in:
Bruce MacDonald
2023-10-30 11:10:18 -04:00
committed by GitHub
parent 8d03bd7b54
commit f9a4281124
2 changed files with 28 additions and 27 deletions

View File

@@ -614,6 +614,22 @@ var defaultAllowOrigins = []string{
}
func Serve(ln net.Listener, allowOrigins []string) error {
if noprune := os.Getenv("OLLAMA_NOPRUNE"); noprune == "" {
// clean up unused layers and manifests
if err := PruneLayers(); err != nil {
return err
}
manifestsPath, err := GetManifestPath()
if err != nil {
return err
}
if err := PruneDirectory(manifestsPath); err != nil {
return err
}
}
config := cors.DefaultConfig()
config.AllowWildcard = true