x/api: fix broken build

This commit is contained in:
Blake Mizerany 2024-04-07 16:42:05 -07:00
parent f595dea189
commit 38e7ddb39d

View File

@ -10,7 +10,7 @@ import (
"github.com/ollama/ollama/x/client/ollama/apitype" "github.com/ollama/ollama/x/client/ollama/apitype"
"github.com/ollama/ollama/x/oweb" "github.com/ollama/ollama/x/oweb"
"github.com/ollama/ollama/x/registry" "github.com/ollama/ollama/x/registry"
regtype "github.com/ollama/ollama/x/registry" regtype "github.com/ollama/ollama/x/registry/apitype"
) )
// Common API Errors // Common API Errors
@ -82,14 +82,11 @@ func (s *Server) handlePush(_ http.ResponseWriter, r *http.Request) error {
return err return err
} }
defer f.Close() defer f.Close()
etag, err := registry.PushLayer(r.Context(), rq.URL, rq.Offset, rq.Size, f) cp, err := registry.PushLayer(r.Context(), f, rq.URL, rq.Offset, rq.Size)
if err != nil { if err != nil {
return err return err
} }
uploads = append(uploads, regtype.CompletePart{ uploads = append(uploads, cp)
URL: rq.URL,
ETag: etag,
})
return nil return nil
}() }()
if err != nil { if err != nil {