Skip to content

Commit

Permalink
New job type KAsyncValidateLiveMediaServers
Browse files Browse the repository at this point in the history
  • Loading branch information
tan-tan-kanarek committed Nov 28, 2013
1 parent 4d3f200 commit 62f49eb
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php
/**
* @package Scheduler
* @subpackage ValidateLiveMediaServers
*/

/**
* Validates periodically that all live entries are still broadcasting to the connected media servers
*
* @package Scheduler
* @subpackage ValidateLiveMediaServers
*/
class KAsyncValidateLiveMediaServers extends KPeriodicWorker
{
/* (non-PHPdoc)
* @see KBatchBase::getType()
*/
public static function getType()
{
return KalturaBatchJobType::CLEANUP;
}

/* (non-PHPdoc)
* @see KBatchBase::run()
*/
public function run($jobs = null)
{
KalturaLog::info("Validating live media servers");

$filter = new KalturaLiveEntryFilter();
$filter->orderBy = KalturaLiveEntryOrderBy::CREATED_AT_ASC;

$entries = self::$kClient->liveStream->listAction($filter);
while(count($entries->objects))
{
foreach($entries->objects as $entry)
{
/* @var $entry KalturaLiveEntry */
self::impersonate($entry->partnerId);
self::$kClient->liveStream->validateRegisteredMediaServers($entry->id);
self::unimpersonate();

$filter->createdAtGreaterThanOrEqual = $entry->createdAt;
}

$entries = self::$kClient->liveStream->listAction($filter);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* @package Scheduler
* @subpackage Debug
*/

chdir(dirname(__FILE__) . "/../../");

require_once (__DIR__ . "/../../bootstrap.php");

$iniDir = dirname(__FILE__) . "/../configurations/batch"; // should be the full file path


$kdebuger = new KGenericDebuger($iniDir);
$kdebuger->run('KAsyncValidateLiveMediaServers');
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Will run the KAsyncValidateLiveMediaServers
*
* @package Scheduler
* @subpackage ValidateLiveMediaServers
*/
require_once (__DIR__ . "/../../bootstrap.php");

$instance = new KAsyncValidateLiveMediaServers();
$instance->run();
$instance->done();

0 comments on commit 62f49eb

Please sign in to comment.