Strengthen push device health checks
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user