Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mjh1 committed Jul 25, 2024
1 parent 391709e commit 44e0fd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
13 changes: 7 additions & 6 deletions clients/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ import (
)

const (
MasterManifestFilename = "index.m3u8"
DashManifestFilename = "index.mpd"
ClipManifestFilename = "clip.m3u8"
ManifestUploadTimeout = 5 * time.Minute
Fmp4PostfixDir = "fmp4"
MasterManifestFilename = "index.m3u8"
DashManifestFilename = "index.mpd"
ClipManifestFilename = "clip.m3u8"
ManifestUploadTimeout = 5 * time.Minute
Fmp4PostfixDir = "fmp4"
manifestNotFoundTolerance = 10 * time.Second
)

func DownloadRetryBackoffLong() backoff.BackOff {
Expand Down Expand Up @@ -168,7 +169,7 @@ func downloadManifest(requestID, sourceManifestOSURL string) (playlist m3u8.Play
err = backoff.Retry(func() error {
rc, err := GetFile(context.Background(), requestID, sourceManifestOSURL, dStorage)
if err != nil {
if time.Since(start) > 10*time.Second && errors.IsObjectNotFound(err) {
if time.Since(start) > manifestNotFoundTolerance && errors.IsObjectNotFound(err) {
// bail out of the retries earlier for not found errors because it will be quite a common scenario
// where the backup manifest does not exist and we don't want to wait the whole 50s of retries for
// every recording job
Expand Down
1 change: 1 addition & 0 deletions config/storage_backup_url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "testing"

func TestGetStorageBackupURL(t *testing.T) {
StorageFallbackURLs = map[string]string{"https://storj.livepeer.com/catalyst-recordings-com/hls": "https://google.livepeer.com/catalyst-recordings-com/hls"}
defer func() { StorageFallbackURLs = nil }()
tests := []struct {
name string
urlStr string
Expand Down

0 comments on commit 44e0fd8

Please sign in to comment.