Skip to content

Commit

Permalink
Merge pull request #2 from Electr0Hub/fix-little-error-on-restreamer
Browse files Browse the repository at this point in the history
Fixed little bug which could cause errors (uncommented previously com…
  • Loading branch information
alkhachatryan authored Jul 21, 2024
2 parents cef0bf6 + 31acfba commit b78111d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/Console/Commands/RestreamCamera.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public function handle()
// Sometimes for some unknown reason supervisor creates many times the same process for streaming a camera.
// Here we check, if there is already a process for this camera - just cancel it.
exec("ps aux | grep 'artisan restream:camera --camera=$cameraOption' | grep -v grep | awk '{print $2}'", $output);
// if (count($output) !== 0) {
// exit();
// }
if (count($output) !== 0) {
exit();
}

// Fetch the camera(s) based on the option
$camera = Camera::find($cameraOption);
Expand All @@ -69,7 +69,7 @@ public function handle()

$this->restreamCamera($client, $camera);
} catch (\Exception $exception) {
Log::channel("streams")->error($exception);
$this->error($exception);
throw $exception;
}
}
Expand Down

0 comments on commit b78111d

Please sign in to comment.