This commit is contained in:
Michael Yang
2023-12-15 14:07:34 -08:00
parent acfc376efd
commit 2bb2bdd5d4
11 changed files with 15 additions and 15 deletions

View File

@@ -138,7 +138,7 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *Regis
}
defer file.Close()
file.Truncate(b.Total)
_ = file.Truncate(b.Total)
g, inner := errgroup.WithContext(ctx)
g.SetLimit(numDownloadParts)
@@ -340,6 +340,7 @@ func downloadBlob(ctx context.Context, opts downloadOpts) error {
return err
}
// nolint: contextcheck
go download.Run(context.Background(), requestURL, opts.regOpts)
}

View File

@@ -747,6 +747,7 @@ func deleteUnusedLayers(skipModelPath *ModelPath, deleteMap map[string]struct{},
// save (i.e. delete from the deleteMap) any files used in other manifests
manifest, _, err := GetManifest(fmp)
if err != nil {
// nolint: nilerr
return nil
}

View File

@@ -748,6 +748,7 @@ func ListModelsHandler(c *gin.Context) {
resp, err := modelResponse(tag)
if err != nil {
log.Printf("skipping file: %s", fp)
// nolint: nilerr
return nil
}

View File

@@ -193,8 +193,8 @@ func Test_Routes(t *testing.T) {
}
resp, err := httpSrv.Client().Do(req)
defer resp.Body.Close()
assert.Nil(t, err)
defer resp.Body.Close()
if tc.Expected != nil {
tc.Expected(t, resp)

View File

@@ -395,6 +395,7 @@ func uploadBlob(ctx context.Context, mp ModelPath, layer *Layer, opts *RegistryO
return err
}
// nolint: contextcheck
go upload.Run(context.Background(), opts)
}