mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 10:34:34 +00:00
Fix #865 : add route in API for scheduler infos
This commit is contained in:
@@ -94,6 +94,33 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
return $this->version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of key-values informations about scheduler
|
||||
*
|
||||
* @param Application $app The silex application
|
||||
* @return \API_V1_result
|
||||
*/
|
||||
public function get_scheduler(Application $app)
|
||||
{
|
||||
$result = new \API_V1_result($app['request'], $this);
|
||||
|
||||
$appbox = \appbox::get_instance($app['Core']);
|
||||
$taskManager = new \task_manager($appbox);
|
||||
$ret = $taskManager->getSchedulerState();
|
||||
|
||||
$ret['state'] = $ret['status'];
|
||||
|
||||
unset($ret['qdelay'], $ret['status']);
|
||||
|
||||
if (null !== $ret['updated_on']) {
|
||||
$ret['updated_on'] = $ret['updated_on']->format(DATE_ATOM);
|
||||
}
|
||||
|
||||
$result->set_datas(array('scheduler' => $ret));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of phraseanet tasks
|
||||
*
|
||||
|
Reference in New Issue
Block a user