From be6061f59eca1657dab79b86df3964000a6f8445 Mon Sep 17 00:00:00 2001 From: Jephte Clain Date: Wed, 22 May 2024 21:15:02 +0400 Subject: [PATCH] ajout exitcode dans RunFile --- src/file/app/RunFile.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/file/app/RunFile.php b/src/file/app/RunFile.php index 6dee6ba..e99e7fd 100644 --- a/src/file/app/RunFile.php +++ b/src/file/app/RunFile.php @@ -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";