mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +00:00
Improvements and updated documentation
This commit is contained in:
@@ -9,7 +9,7 @@ if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
* - This is a Job Queue Worker that gets scheduled LRTs from the queue and executes them
|
||||
* - Once all the LRTs have been started checks if there are LRTs that are running for too long and kills them
|
||||
*/
|
||||
class LongRunTaskExecJob extends JQW_Controller
|
||||
class LongRunTaskExecJob extends JOB_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
@@ -72,6 +72,10 @@ class LongRunTaskExecJob extends JQW_Controller
|
||||
{
|
||||
// Kill the process with a SIGKILL
|
||||
exec('kill -9 '.$lrt->pid.' > /dev/null 2>&1');
|
||||
|
||||
// Set the LRT as failed
|
||||
$lrtExecFailedResult = $this->longruntasklib->lrtExecFailed($lrt->jobid);
|
||||
if (isError($lrtExecFailedResult)) $this->logError(getError(lrtExecFailedResult));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class LRTDummy extends LRT_Controller
|
||||
$this->_jobid = $jobid;
|
||||
|
||||
// Get the LRT record related to the provided jobid
|
||||
$lrtResult = $this->getLrt($jobid);
|
||||
$lrtResult = $this->getLrt();
|
||||
|
||||
// If an error occurred or the record has not been found
|
||||
if (isError($lrtResult) || !hasData($lrtResult))
|
||||
@@ -48,7 +48,7 @@ class LRTDummy extends LRT_Controller
|
||||
{
|
||||
sleep(1);
|
||||
// Set the progress
|
||||
$setProgressResult = $this->setProgress($jobid, (($i + 1) / (int)$input->sleep) * 100);
|
||||
$setProgressResult = $this->setProgress((($i + 1) / (int)$input->sleep) * 100);
|
||||
if (isError($setProgressResult))
|
||||
{
|
||||
$this->logError($setProgressResult);
|
||||
@@ -62,7 +62,7 @@ class LRTDummy extends LRT_Controller
|
||||
$this->logInfo('The user '.$lrt->uid.' slept for '.$input->sleep.' seconds');
|
||||
|
||||
// Set the output
|
||||
$setOutputResult = $this->setOutput($jobid, 'The user '.$lrt->uid.' slept for '.$input->sleep.' seconds');
|
||||
$setOutputResult = $this->setOutput('The user '.$lrt->uid.' slept for '.$input->sleep.' seconds');
|
||||
if (isError($setOutputResult))
|
||||
{
|
||||
$this->logError($setOutputResult);
|
||||
|
||||
Reference in New Issue
Block a user