Skip to content

Commit

Permalink
build: enhance test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean Honlet committed Feb 26, 2025
1 parent 25b110c commit ac63c1c
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions www/maintenance/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

try {
ob_start();
http_response_code(500);
http_response_code(418);
$res = true;
echo "<h1>Check</h1>";

Expand All @@ -28,21 +28,15 @@
echo "Version match<br>";
} else {
echo "!! Version mismatch<br>";
$res = false;
throw new Error("Test failed");
}

echo "\n<br>";

if ($res) {
echo "Ok<br>\n";
http_response_code(200);
} else {
echo "Failed<br>\n";
http_response_code(503);
}
} catch (e) {
http_response_code(200);
} catch (Throwable $e) {
echo "Exception<br>\n";
var_dump($e);
http_response_code(503);
http_response_code(500);
}
ob_flush();

while (@ob_end_flush());

0 comments on commit ac63c1c

Please sign in to comment.