always remove from in progress map on download

This commit is contained in:
Bruce MacDonald 2023-08-15 13:20:32 -03:00 committed by GitHub
commit 12052a7624
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -113,6 +113,7 @@ var chunkSize = 1024 * 1024 // 1 MiB in bytes
// doDownload downloads a blob from the registry and stores it in the blobs directory
func doDownload(ctx context.Context, mp ModelPath, regOpts *RegistryOptions, f *FileDownload, fn func(api.ProgressResponse)) error {
defer inProgress.Delete(f.Digest)
var size int64
fi, err := os.Stat(f.FilePath + "-partial")
@ -208,8 +209,6 @@ outerLoop:
inProgress.Store(f.Digest, f)
}
inProgress.Delete(f.Digest)
log.Printf("success getting %s\n", f.Digest)
return nil
}