ajout exitcode dans RunFile

This commit is contained in:
Jephté Clain 2024-05-22 21:15:02 +04:00
parent 4eaac65be3
commit be6061f59e
1 changed files with 10 additions and 1 deletions

View File

@ -42,10 +42,11 @@ class RunFile {
"serial" => 0,
"date_start" => $dateStart,
"date_stop" => null,
"exitcode" => null,
"action" => null,
"action_date_start" => null,
"action_max_step" => null,
"action_current_step" => null,
"action_max_step" => null,
"action_date_step" => null,
];
}
@ -119,6 +120,14 @@ class RunFile {
]));
}
/** après l'arrêt de l'application, mettre à jour le code de retour */
function stopped(int $exitcode): void {
[$file, $data] = $this->willWrite();
$file->serialize(self::merge($data, [
"exitcode" => $exitcode,
]));
}
function getLockFile(?string $name=null, ?string $title=null): LockFile {
$ext = self::LOCK_EXT;
if ($name !== null) $ext = ".$name$ext";