1
0
mirror of https://github.com/FloatTech/zbpdata.git synced 2024-11-17 17:47:14 +09:00

feat: 改为并行上传

This commit is contained in:
源文雨 2022-04-17 16:18:12 +08:00
parent 50b189ebad
commit fb80a176f0

View File

@ -47,6 +47,14 @@ func main() {
panic(err)
}
defer r.Close()
for i := 0; i < 1024; i++ {
err = r.Set("__setlock__", "fill")
if err == nil {
break
}
fmt.Println("accqiring set lock, retry times:", i)
process.SleepAbout1sTo2s()
}
var wg sync.WaitGroup
wg.Add(len(files))
for i, fn := range files {