mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
- Added new protected method getOldestJobs to core/JQW_Controller
- Changed method JQW_Controller->getOldestJob to be a wrapper for getOldestJobs - Changed method generateJobs to be a wrapper for static method JobsQueueLib::generateJobs - Removed method JobsQueueLib->getOldestJob - Added new public method getOldestJobs to JobsQueueLib - Added new public static method generateJobs to JobsQueueLib
This commit is contained in:
@@ -49,10 +49,20 @@ abstract class JQW_Controller extends JOB_Controller
|
||||
|
||||
/**
|
||||
* To get the oldest added job using the given job type
|
||||
* NOTE: just a wrapper
|
||||
*/
|
||||
protected function getOldestJob($type)
|
||||
{
|
||||
$jobs = $this->jobsqueuelib->getOldestJob($type);
|
||||
return $this->getOldestJobs($type, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* To get the oldest added jobs using the given job type
|
||||
* It is eventually specify the maximum amount of jobs to be retrieved
|
||||
*/
|
||||
protected function getOldestJobs($type, $maxAmount)
|
||||
{
|
||||
$jobs = $this->jobsqueuelib->getOldestJobs($type, $maxAmount);
|
||||
|
||||
// If an error occurred then log it in database
|
||||
if (isError($jobs)) $this->logError(getError($jobs), $type);
|
||||
@@ -131,12 +141,7 @@ abstract class JQW_Controller extends JOB_Controller
|
||||
*/
|
||||
protected function generateJobs($status, $input)
|
||||
{
|
||||
$job = new stdClass();
|
||||
|
||||
$job->{JobsQueueLib::PROPERTY_STATUS} = $status;
|
||||
$job->{JobsQueueLib::PROPERTY_INPUT} = $input;
|
||||
|
||||
return array($job);
|
||||
return JobsQueueLib::generateJobs($status, $input);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user