Fixed error logic
Change-Id: I4139a3b3a0b7bc3cd6deec1eac92b5d3c0bdd73a Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
@@ -278,12 +278,16 @@ final class PresentationVideoMediaUploadProcessor
|
||||
?string $mail_to
|
||||
): int
|
||||
{
|
||||
$event_ids = [];
|
||||
$excerpt = 'Starting MUX Assets Enabling MP4 Support Process.'.PHP_EOL;
|
||||
|
||||
try {
|
||||
$event_ids = $this->tx_service->transaction(function () use ($summit_id) {
|
||||
return $this->event_repository->getPublishedEventsIdsBySummit($summit_id);
|
||||
});
|
||||
|
||||
$this->_configMux($credentials);
|
||||
$excerpt = 'Starting MUX Assets Enabling MP4 Support Process.'.PHP_EOL;
|
||||
|
||||
|
||||
foreach ($event_ids as $event_id) {
|
||||
Log::warning(sprintf("PresentationVideoMediaUploadProcessor::processMuxAssetsFromStreamUrl processing event %s", $event_id));
|
||||
@@ -321,14 +325,13 @@ final class PresentationVideoMediaUploadProcessor
|
||||
$event->setMuxAssetId($asset_id);
|
||||
$assetResponse = $this->assets_api->getAsset($asset_id);
|
||||
$staticRenditions = $assetResponse->getData()->getStaticRenditions();
|
||||
if(!is_null($staticRenditions)){
|
||||
if (!is_null($staticRenditions)) {
|
||||
$excerpt .= sprintf("event %s - mux asset id (%s) - has already enabled mp4 support.", $event_id, $asset_id) . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
$this->_enableMP4Support($asset_id);
|
||||
$excerpt .= sprintf("event %s - mux asset id (%s) - has been enabled mp4 support.", $event_id, $asset_id) . PHP_EOL;
|
||||
}
|
||||
catch (\Exception $ex) {
|
||||
} catch (\Exception $ex) {
|
||||
$excerpt .= sprintf("event %s - error on enabling mp4 support.", $event_id) . PHP_EOL;
|
||||
Log::warning($ex);
|
||||
throw $ex;
|
||||
@@ -340,6 +343,11 @@ final class PresentationVideoMediaUploadProcessor
|
||||
}
|
||||
|
||||
$excerpt .= sprintf("%s events processed.", count($event_ids)) . PHP_EOL;
|
||||
}
|
||||
catch (\Exception $ex){
|
||||
$excerpt .= sprintf("Process Error %s", $ex->getMessage()) . PHP_EOL;
|
||||
Log::error($ex);
|
||||
}
|
||||
|
||||
if (!empty($mail_to))
|
||||
Mail::queue(new MUXExportExcerptMail($mail_to, "MUX Assets MP4 Enabling Process", $excerpt));
|
||||
@@ -367,13 +375,14 @@ final class PresentationVideoMediaUploadProcessor
|
||||
MuxCredentials $credentials,
|
||||
?string $mail_to): int
|
||||
{
|
||||
|
||||
$event_ids = [];
|
||||
$excerpt = 'Starting Create Videos From MUX Assets Process.'.PHP_EOL;
|
||||
try {
|
||||
$event_ids = $this->tx_service->transaction(function () use ($summit_id) {
|
||||
return $this->event_repository->getPublishedEventsIdsBySummit($summit_id);
|
||||
});
|
||||
|
||||
$this->_configMux($credentials);
|
||||
$excerpt = 'Starting Create Videos From MUX Assets Process.'.PHP_EOL;
|
||||
|
||||
foreach ($event_ids as $event_id) {
|
||||
$this->tx_service->transaction(function () use ($event_id, $credentials, &$excerpt) {
|
||||
@@ -397,7 +406,7 @@ final class PresentationVideoMediaUploadProcessor
|
||||
}
|
||||
|
||||
$assetId = $event->getMuxAssetId();
|
||||
if(empty($assetId)){
|
||||
if (empty($assetId)) {
|
||||
$excerpt .= sprintf("event %s not processed.", $event_id) . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
@@ -405,7 +414,7 @@ final class PresentationVideoMediaUploadProcessor
|
||||
$result = $this->assets_api->getAsset($assetId);
|
||||
$staticRenditions = $result->getData()->getStaticRenditions();
|
||||
|
||||
if(is_null($staticRenditions)){
|
||||
if (is_null($staticRenditions)) {
|
||||
$excerpt .= sprintf("event %s - mp4 not enabled.", $event_id) . PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
@@ -449,7 +458,11 @@ final class PresentationVideoMediaUploadProcessor
|
||||
}
|
||||
|
||||
$excerpt .= sprintf("%s events processed.", count($event_ids)) . PHP_EOL;
|
||||
|
||||
}
|
||||
catch (\Exception $ex){
|
||||
$excerpt .= sprintf("Process Error %s", $ex->getMessage()) . PHP_EOL;
|
||||
Log::error($ex);
|
||||
}
|
||||
if (!empty($mail_to))
|
||||
Mail::queue(new MUXExportExcerptMail($mail_to, "Videos Creation Process", $excerpt));
|
||||
|
||||
|
Reference in New Issue
Block a user