Improvements and updated documentation

This commit is contained in:
Paolo
2026-06-23 12:33:44 +02:00
parent 5826bf5b70
commit 8126665acd
5 changed files with 46 additions and 30 deletions
+24 -4
View File
@@ -52,7 +52,7 @@ class LongRunTaskLib extends JobsQueueLib
}
/**
*
* Get all the LRT that are running more then CFG_LRT_MAX_RUN hours
*/
public function getHangingLRTs()
{
@@ -109,6 +109,20 @@ class LongRunTaskLib extends JobsQueueLib
if (isError($updateLrtResult)) return $updateLrtResult;
}
/**
* Set the LRT in the queue as failed
*/
public function lrtExecFailed($jobid)
{
return $this->_ci->JobsQueueModel->update(
$jobid,
array(
'endtime' => 'NOW()',
'status' => self::STATUS_FAILED
)
);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods used by the front end applications (standard controllers/end points, ex. controllers/system/LRTTest.php)
@@ -209,11 +223,17 @@ class LongRunTaskLib extends JobsQueueLib
}
/**
*
* Set the LRT in the queue as successfully ended
*/
public function setStatus($jobid, $status)
public function lrtExecOver($jobid)
{
return $this->_ci->JobsQueueModel->update($jobid, array('status' => $status));
return $this->_ci->JobsQueueModel->update(
$jobid,
array(
'endtime' => 'NOW()',
'status' => self::STATUS_DONE
)
);
}
}