- 简化响应体关闭逻辑,移除不必要的nil检查 - 调整后台状态推送频率,从500ms改为250ms - 修复前端事件监听器注册顺序 - 移除未使用的进度变量 - 优化goroutine中的任务执行逻辑 - 改进文件路径显示,统一使用文件名而非完整路径 - 添加waitgroup等待确保资源正确释放
This commit is contained in:
+3
-4
@@ -38,9 +38,8 @@ func UploadDataToServer(ctx context.Context, data string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if resp != nil {
|
||||
_, _ = io.Copy(io.Discard, resp.Body)
|
||||
resp.Body.Close()
|
||||
}
|
||||
io.Copy(io.Discard, resp.Body)
|
||||
resp.Body.Close()
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user