Commit f23543e4 by Li Feifei

改为异步请求

parent d8f01607
Pipeline #16072 passed with stages
in 35 seconds
...@@ -156,10 +156,11 @@ func (f *ObtainFile) uploadPicture() error { ...@@ -156,10 +156,11 @@ func (f *ObtainFile) uploadPicture() error {
defer reader.Close() defer reader.Close()
pool := workpool.New(100) pool := workpool.New(100)
for _, file := range reader.File { for _, file := range reader.File {
tempFile := file
pool.Do(func() error { pool.Do(func() error {
return f.task(file) return f.task(tempFile)
}) })
} }
return pool.Wait() return pool.Wait()
......
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