Skip to content

Commit

Permalink
refactor log
Browse files Browse the repository at this point in the history
  • Loading branch information
rkodev committed Feb 16, 2024
1 parent d1613bf commit 2373109
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fileuploader/large_file_upload_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,17 @@ func NewLargeFileUploadTask[T serialization.Parsable](adapter abstractions.Reque
// Upload uploads the byteStream in slices and returns the result of the upload
func (l *largeFileUploadTask[T]) Upload(progress ProgressCallBack) UploadResult[T] {
result := NewUploadResult[T]()
var wg sync.WaitGroup
slices := l.createUploadSlices()
maxRetriesPerRequest := 3

// slices of errors
var responseErrors []error
var itemResponse T

var wg sync.WaitGroup
wg.Add(len(slices))

for _, slice := range slices {
wg.Add(1)
uploadSlice := slice
go func() {
defer wg.Done()
Expand All @@ -71,6 +73,7 @@ func (l *largeFileUploadTask[T]) Upload(progress ProgressCallBack) UploadResult[
}
}()
}

wg.Wait()

if len(responseErrors) > 0 {
Expand Down

0 comments on commit 2373109

Please sign in to comment.