- Added new constant BEGINNING_OF_TIME

- Added new config entry job_type_permissions_white_list in jqm.php
- Added new navigation entry jobsqueueviewer
- Added new model application/models/system/JobsQueue_model.php
- Added new option in FilterWidget for hours comparison with dates
- Added new filter core-jq-lastHour to system/filtersupdate.php
- Added new statements to system/dbupdate_3.3.php to create tables system.tbl_jobstatuses, system.tbl_jobtypes and system.tbl_jobstatuses
- Added new views application/views/system/jq/jobsQueueViewer.php and application/views/system/jq/jobsQueueViewerData.php
This commit is contained in:
Paolo
2020-03-05 15:57:06 +01:00
parent 30c6f10d80
commit cd815acdbf
16 changed files with 462 additions and 88 deletions
+20 -13
View File
@@ -3,18 +3,22 @@
if (!defined("BASEPATH")) exit("No direct script access allowed");
/**
* Job Queue Worker
*
* This controller acts as interface of the JobsQueueLib that contains all the needed functionalities to operate with
* the Jobs Queue System
* This is an abstract class that provide basic functionalities, it has to be extended to broaden its logic
*/
abstract class JQW_Controller extends JOB_Controller
{
/**
*
* Constructor
*/
public function __construct()
{
parent::__construct();
// Loads LogLib with different ...
// Loads LogLib with different parameters
$this->load->library('LogLib', array(
'classIndex' => 5,
'functionIndex' => 5,
@@ -23,33 +27,36 @@ abstract class JQW_Controller extends JOB_Controller
'dbExecuteUser' => 'Jobs queue system'
));
// Loads JobsQueueLib
// Loads JobsQueueLib library
$this->load->library('JobsQueueLib');
}
// ------------------------------------------------------------------------------------------------------------
// Protected methods to read/write the jobs queue
//------------------------------------------------------------------------------------------------------------------
// Protected methods
/**
*
* To get all the most recently added jobs using the given job type
*/
protected function getJobsByType($jobType)
protected function getLastJobs($type)
{
$jobs = $this->jobsqueuelib->getJobsByType($jobType);
$jobs = $this->jobsqueuelib->getLastJobs($type);
if (isError($jobs)) $this->logError(getError($jobs), $jobType);
// If an error occurred then log it in database
if (isError($jobs)) $this->logError(getError($jobs), $type);
return $jobs;
}
/**
*
* Add new jobs in the jobs queue with the given type
* jobs is an array of job objects
*/
protected function addNewJobsToQueue($jobType, $jobs)
protected function addNewJobsToQueue($type, $jobs)
{
$result = $this->jobsqueuelib->addNewJobsToQueue($jobType, $jobs);
$result = $this->jobsqueuelib->addNewJobsToQueue($type, $jobs);
if (isError($result)) $this->logError(getError($result), $jobType);
// If an error occurred then log it in database
if (isError($result)) $this->logError(getError($result), $type);
return $result;
}