Commit dfd245ab authored by Mark Harding's avatar Mark Harding

(fix): do not return created in status check

1 merge request!414WIP: New transcoder
Pipeline #101997607 passed with stages
in 7 minutes and 24 seconds
......@@ -40,6 +40,7 @@ class TranscodeStates
'guid' => $video->getGuid(),
]);
$created = 0;
$failures = 0;
$completed = 0;
......@@ -58,7 +59,7 @@ class TranscodeStates
break;
case TranscodeStates::CREATED:
// If not started to transcode then we are in a created state
return TranscodeStates::CREATED;
++$created;
break;
case TranscodeStates::FAILED:
++$failures;
......@@ -66,11 +67,14 @@ class TranscodeStates
break;
case TranscodeStates::COMPLETED:
++$completed;
// We should allow failures for some transcodes
break;
}
}
if ($created > ($completed + $failures)) {
return TranscodeStates::CREATED;
}
// If we have more completions then failures the declare completed
if ($failures < $completed) {
return TranscodeStates::COMPLETED;
......
Please register or to comment