mirror of
https://github.com/Lukas0025/YAGS.git
synced 2025-04-24 15:51:37 +01:00
Added auto fail observation when timeout
This commit is contained in:
parent
aaf501aff1
commit
75b6558063
@ -2,7 +2,8 @@
|
|||||||
namespace API\cron;
|
namespace API\cron;
|
||||||
|
|
||||||
function all($params) {
|
function all($params) {
|
||||||
|
tle($params);
|
||||||
|
autoFail($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
function tle($params) {
|
function tle($params) {
|
||||||
@ -37,3 +38,16 @@
|
|||||||
|
|
||||||
return $updated;
|
return $updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function autoFail($params) {
|
||||||
|
$observations = new \wsos\database\core\table(\DAL\observation::class);
|
||||||
|
$ob = new \DAL\observation();
|
||||||
|
|
||||||
|
$faild = $observations->query("status==? && start<?", [$ob->status->getVal("assigned"), time() - 300]);
|
||||||
|
|
||||||
|
foreach ($fob in $faild->values) {
|
||||||
|
$fob->status->set("fail");
|
||||||
|
$fob->commit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user