Skip to content

Commit 209a492

Browse files
author
Daniel Neto
committed
Update
1 parent 7ef892c commit 209a492

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

objects/Encoder.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,10 @@ public function setFilename($filename)
330330
$this->filename = $filename;
331331
}
332332

333-
public function setStatus($status)
333+
public function setStatus($status, $setStreamerLog = true)
334334
{
335335
_error_log("Encoder::setStatus($status) " . json_encode(debug_backtrace()));
336-
if (!empty($this->id) && $status != $this->status) {
336+
if ($setStreamerLog && !empty($this->id) && $status != $this->status) {
337337
self::setStreamerLog($this->id, "Status changed from {$this->status} to $status", Encoder::LOG_TYPE_StatusChanged);
338338
}
339339
$this->status = $status;
@@ -3017,7 +3017,15 @@ public static function setStreamerLog($encoder_queue_id, $msg, $type)
30173017
'type' => $type,
30183018
'videos_id' => $return_vars->videos_id,
30193019
);
3020-
return self::sendToStreamer($target, $postFields, $return_vars, $encoder);
3020+
$response = self::sendToStreamer($target, $postFields, $return_vars, $encoder);
3021+
if (!empty($response->doNotRetry)) {
3022+
_error_log("sendToStreamer timeout. Not retrying.");
3023+
$q = new Encoder($encoder_queue_id);
3024+
$q->setStatus(Encoder::STATUS_ERROR);
3025+
$q->setStatus_obs("sendToStreamer timeout. Not retrying.");
3026+
$q->save();
3027+
}
3028+
return $response;
30213029
}
30223030

30233031
public static function getVideosId($encoder_queue_id)

0 commit comments

Comments
 (0)