Skip to content

Commit

Permalink
Relax timeout for re-doing transcode (#7581)
Browse files Browse the repository at this point in the history
  • Loading branch information
stereosteve authored Feb 14, 2024
1 parent 4ae791d commit 1fe3be6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mediorum/server/transcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,22 @@ func (ss *MediorumServer) findMissedJobs(work chan *Upload, myHost string, retra
if myRank == 2 {
// no recent update?
timedOut = upload.Status == busyStatus &&
time.Since(upload.TranscodedAt) > time.Minute
time.Since(upload.TranscodedAt) > time.Minute*3

// never started?
neverStarted = upload.Status == newStatus &&
time.Since(upload.CreatedAt) > time.Minute*2
time.Since(upload.CreatedAt) > time.Minute*6
}

// for #3 rank worker:
if myRank == 3 {
// no recent update?
timedOut = upload.Status == busyStatus &&
time.Since(upload.TranscodedAt) > time.Minute*5
time.Since(upload.TranscodedAt) > time.Minute*7

// never started?
neverStarted = upload.Status == newStatus &&
time.Since(upload.CreatedAt) > time.Minute*5
time.Since(upload.CreatedAt) > time.Minute*14
}

if timedOut {
Expand Down
4 changes: 4 additions & 0 deletions mediorum/server/upload_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ func (ss *MediorumServer) startUploadScroller() {
uploadCursor.After = upload.CreatedAt
}

if len(uploads) == 0 {
continue
}

// write overwrites
err = ss.crud.DB.Clauses(clause.OnConflict{UpdateAll: true}).Create(overwrites).Error
if err != nil {
Expand Down

0 comments on commit 1fe3be6

Please sign in to comment.