Skip to content

Commit

Permalink
server: Introduce constant common.SegmentUploadTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko committed Dec 6, 2021
1 parent 381768f commit 166d638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ import (
// HTTPTimeout timeout used in HTTP connections between nodes
var HTTPTimeout = 8 * time.Second

// SegmentUploadTimeout timeout used in HTTP connections for uploading the segment
var SegmentUploadTimeout = 2 * time.Second

// Max Segment Duration
var MaxDuration = (5 * time.Minute)

Expand Down
2 changes: 1 addition & 1 deletion server/segment_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ func SubmitSegment(sess *BroadcastSession, seg *stream.HLSSegment, nonce uint64,
// timeout for the segment upload, until HTTP returns OK 200
uploadTimeout := time.Duration(segUploadTimeoutMultiplier * seg.Duration * float64(time.Second))
if uploadTimeout <= 0 {
uploadTimeout = httpTimeout
uploadTimeout = common.SegmentUploadTimeout
}

ctx, cancel := context.WithTimeout(context.Background(), httpTimeout)
Expand Down

0 comments on commit 166d638

Please sign in to comment.