MCPcopy Create free account
hub / github.com/imroc/req / popTask

Method popTask

parallel_download.go:50–67  ·  view source on GitHub ↗
(index int)

Source from the content-addressed store, hash-verified

48}
49
50func (pd *ParallelDownload) popTask(index int) *downloadTask {
51 pd.mu.Lock()
52 if task, ok := pd.taskMap[index]; ok {
53 delete(pd.taskMap, index)
54 pd.mu.Unlock()
55 return task
56 }
57 pd.mu.Unlock()
58 for {
59 task := <-pd.taskNotifyCh
60 if task.index == index {
61 pd.mu.Lock()
62 delete(pd.taskMap, index)
63 pd.mu.Unlock()
64 return task
65 }
66 }
67}
68
69func md5Sum(s string) string {
70 sum := md5.Sum([]byte(s))

Callers 1

mergeFileMethod · 0.95

Calls 2

LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected