Skip to content

Commit

Permalink
Reset the file pointer to the beginning of the file (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
rujhan-arora-astronomer authored May 29, 2024
1 parent d858097 commit 6aad882
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/fileutil/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ func UploadFile(args *UploadFileArguments) error {
if i < args.MaxTries {
retryDelayInMS = backOff(retryDelayInMS, args.BackoffFactor)
}
// Reset the file pointer to the beginning of the file
_, err = file.Seek(0, io.SeekStart)
if err != nil {
return fmt.Errorf("error seeking file: %w", err)
}
}
return currentUploadError
}
Expand Down

0 comments on commit 6aad882

Please sign in to comment.