"git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "377b09cf8cbc3bb8006c94d99c169459d56d9f70"
Unverified Commit 12052a76 authored by Bruce MacDonald's avatar Bruce MacDonald Committed by GitHub
Browse files

always remove from in progress map on download

parents 23e1da77 f020e1d5
...@@ -113,6 +113,7 @@ var chunkSize = 1024 * 1024 // 1 MiB in bytes ...@@ -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 // 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 { func doDownload(ctx context.Context, mp ModelPath, regOpts *RegistryOptions, f *FileDownload, fn func(api.ProgressResponse)) error {
defer inProgress.Delete(f.Digest)
var size int64 var size int64
fi, err := os.Stat(f.FilePath + "-partial") fi, err := os.Stat(f.FilePath + "-partial")
...@@ -208,8 +209,6 @@ outerLoop: ...@@ -208,8 +209,6 @@ outerLoop:
inProgress.Store(f.Digest, f) inProgress.Store(f.Digest, f)
} }
inProgress.Delete(f.Digest)
log.Printf("success getting %s\n", f.Digest) log.Printf("success getting %s\n", f.Digest)
return nil return nil
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment