Skip to content

Commit

Permalink
vodtester: Close files properly (#247)
Browse files Browse the repository at this point in the history
We were relying on HTTP lib for closing it for us,
but that broke retries. Handling the resource on
the place where it is created instead.
  • Loading branch information
victorges authored Jan 23, 2023
1 parent 78d3036 commit 00af4b0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/golang/glog v1.0.0
github.com/gosuri/uilive v0.0.3 // indirect
github.com/gosuri/uiprogress v0.0.1
github.com/livepeer/go-api-client v0.4.2-0.20230105141727-2a1044f1eb2e
github.com/livepeer/go-api-client v0.4.2-0.20230123220918-f572338de3f0
github.com/livepeer/go-livepeer v0.5.31
github.com/livepeer/joy4 v0.1.2-0.20220210094601-95e4d28f5f07
github.com/livepeer/leaderboard-serverless v1.0.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,8 @@ github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/livepeer/go-api-client v0.4.2-0.20230105141727-2a1044f1eb2e h1:R9agI6FLJVOmX7YPR7vA0Rp9ONpDzJbDYSgpNwRHJiQ=
github.com/livepeer/go-api-client v0.4.2-0.20230105141727-2a1044f1eb2e/go.mod h1:Jdb+RI7JyzEZOHd1GUuKofwFDKMO/btTa80SdpUpYQw=
github.com/livepeer/go-api-client v0.4.2-0.20230123220918-f572338de3f0 h1:GqtMRVnhYnlBVDCL5pFo0Fcewv7cw1wXkG9DgsowfE8=
github.com/livepeer/go-api-client v0.4.2-0.20230123220918-f572338de3f0/go.mod h1:Jdb+RI7JyzEZOHd1GUuKofwFDKMO/btTa80SdpUpYQw=
github.com/livepeer/go-livepeer v0.5.31 h1:LcN+qDnqWRws7fdVYc4ucZPVcLQRs2tehUYCQVnlnRw=
github.com/livepeer/go-livepeer v0.5.31/go.mod h1:cpBikcGWApkx0cyR0Ht+uAym7j3uAwXGpPbvaOA8XUU=
github.com/livepeer/joy4 v0.1.2-0.20191121080656-b2fea45cbded/go.mod h1:xkDdm+akniYxVT9KW1Y2Y7Hso6aW+rZObz3nrA9yTHw=
Expand Down
1 change: 1 addition & 0 deletions internal/app/vodtester/vodtester_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func (vt *vodTester) directUploadTester(fileName string, taskPollDuration time.D
glog.Errorf("Error opening file=%s err=%v", fileName, err)
return fmt.Errorf("error opening file=%s: %w", fileName, err)
}
defer file.Close()

err = vt.Lapi.UploadAsset(vt.Ctx, uploadEndpoint, file)
if err != nil {
Expand Down

0 comments on commit 00af4b0

Please sign in to comment.