Merge branch 'feature-11690/SAPByD_User_Update_Request_Limit'

This commit is contained in:
Andreas Österreicher
2021-02-23 08:48:30 +01:00
2 changed files with 26 additions and 0 deletions
+13
View File
@@ -56,6 +56,19 @@ class JobsQueueLib
return $this->_ci->JobsQueueModel->loadWhere(array('status' => self::STATUS_NEW, 'type' => $type));
}
/**
* To get the oldest added jobs using the given job type
*/
public function getOldestJob($type)
{
$this->_ci->JobsQueueModel->resetQuery();
$this->_ci->JobsQueueModel->addOrder('creationtime', 'ASC');
$this->_ci->JobsQueueModel->addLimit('1');
return $this->_ci->JobsQueueModel->loadWhere(array('status' => self::STATUS_NEW, 'type' => $type));
}
/**
* To get all the jobs specified by the given parameters
*/