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
@@ -47,6 +47,19 @@ abstract class JQW_Controller extends JOB_Controller
return $jobs;
}
/**
* To get the oldest added job using the given job type
*/
protected function getOldestJob($type)
{
$jobs = $this->jobsqueuelib->getOldestJob($type);
// If an error occurred then log it in database
if (isError($jobs)) $this->logError(getError($jobs), $type);
return $jobs;
}
/**
* To get all the jobs specified by the given parameters
*/
+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
*/