mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
- Added new protected method getOldestJob to JQW_Controller
- Added new public method getOldestJob to JobsQueueLib
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user