fix(spot): don't miss 'processed' status after trimming without transcoding

This commit is contained in:
Alexander 2024-09-11 09:10:31 +02:00
parent 8e0f0d389d
commit 1a44c0c9c3

View file

@ -102,6 +102,9 @@ func (t *transcoderImpl) failedTask(task *Task, err error) {
}
func (t *transcoderImpl) doneTask(task *Task) {
if err := t.spots.SetStatus(task.SpotID, "processed"); err != nil {
t.log.Error(context.Background(), "Error updating spot status: %v", err)
}
if err := t.tasks.Done(task); err != nil {
t.log.Error(context.Background(), "Error marking task as done: %v", err)
}
@ -167,9 +170,6 @@ func (t *transcoderImpl) transcode(payload interface{}) {
return
}
if err := t.spots.SetStatus(task.SpotID, "processed"); err != nil {
t.log.Error(context.Background(), "Error updating spot status: %v", err)
}
t.doneTask(task)
t.log.Info(context.Background(), "Transcoded spot %d, have to upload chunks to S3", task.SpotID)