Strengthen push device health checks

This commit is contained in:
seo
2026-06-07 06:43:17 +09:00
parent 79208784e2
commit 39aa262469
5 changed files with 295 additions and 9 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/../config/config.php';
$minHours = 24;
$force = false;
foreach (array_slice($argv, 1) as $arg) {
if ($arg === '--force') {
$force = true;
continue;
}
if (str_starts_with($arg, '--min-hours=')) {
$minHours = (int)substr($arg, 12);
}
}
$result = send_push_healthcheck_if_due($minHours, $force);
echo json_encode([
'ok' => true,
'result' => $result,
'summary' => push_health_summary(),
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT) . PHP_EOL;