mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Fix #865 : add route in API for scheduler infos
This commit is contained in:
@@ -119,6 +119,7 @@ class task_manager
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
|
||||
$sql = "SELECT UNIX_TIMESTAMP()-UNIX_TIMESTAMP(schedqtime) AS qdelay
|
||||
, schedqtime AS updated_on
|
||||
, schedstatus AS status FROM sitepreff";
|
||||
$stmt = $this->appbox->get_connection()->prepare($sql);
|
||||
$stmt->execute();
|
||||
@@ -139,6 +140,12 @@ class task_manager
|
||||
fclose($schedlock);
|
||||
}
|
||||
|
||||
if ($ret['updated_on'] == '0000-00-00 00:00:00') {
|
||||
$ret['updated_on'] = null;
|
||||
} else {
|
||||
$ret['updated_on'] = new \DateTime($ret['updated_on']);
|
||||
}
|
||||
|
||||
if ($pid === NULL && $ret['status'] !== 'stopped') {
|
||||
// auto fix
|
||||
$this->appbox->get_connection()->exec('UPDATE sitepreff SET schedstatus=\'stopped\'');
|
||||
|
Reference in New Issue
Block a user