mirror of
https://github.com/Lukas0025/YAGS.git
synced 2025-04-10 17:32:17 +01:00
Merge branch 'main' of https://github.com/Lukas0025/YAGS
This commit is contained in:
commit
4cfce6e23a
@ -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) {
|
||||||
@ -36,4 +37,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -132,14 +132,26 @@
|
|||||||
|
|
||||||
$adir = __DIR__ . "/../ARTEFACTS/" . $params["id"];
|
$adir = __DIR__ . "/../ARTEFACTS/" . $params["id"];
|
||||||
|
|
||||||
|
$fname = basename($params["fname"]);
|
||||||
|
|
||||||
mkdir($adir, 0777, true);
|
mkdir($adir, 0777, true);
|
||||||
|
|
||||||
$artefacts = $obs->artefacts->get();
|
// chunk upload file
|
||||||
foreach ($_FILES as $file) {
|
if ($params["offset"] == 0) {
|
||||||
move_uploaded_file($file["tmp_name"], $adir . "/" . $file["name"]);
|
// get current artifasts
|
||||||
$artefacts[] = "/ARTEFACTS/{$params['id']}/{$file['name']}";
|
$artefacts = $obs->artefacts->get();
|
||||||
|
|
||||||
|
$artefacts[] = "/ARTEFACTS/{$params['id']}/{$fname}";
|
||||||
|
|
||||||
|
$obs->artefacts->set($artefacts);
|
||||||
|
$obs->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
$obs->artefacts->set($artefacts);
|
// file pointer
|
||||||
$obs->commit();
|
$ifp = fopen($adir . "/" . $fname, 'ab');
|
||||||
|
|
||||||
|
fwrite($ifp, $params["data"]);
|
||||||
|
|
||||||
|
// clean up the file resource
|
||||||
|
fclose($ifp);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user