mirror of
https://github.com/Terranom674/Piwigo_Bratonien_Tools.git
synced 2026-11-04 23:02:16 +00:00
Detect stalled manual cache builds in status endpoint
This commit is contained in:
1 parent
d81c1a120a
commit
8a2d541139
1 file changed
+9
@@ -44,4 +44,13 @@ if (!is_array($data))
|
||||
exit;
|
||||
}
|
||||
|
||||
$state = (string)($data['state'] ?? 'idle');
|
||||
$updated = (int)($data['updated_at'] ?? 0);
|
||||
if (($state === 'running' || $state === 'queued') && $updated > 0 && (time() - $updated) > 45)
|
||||
{
|
||||
$data['state'] = 'error';
|
||||
$data['message'] = 'Cache-Aufbau liefert seit mehr als 45 Sekunden keinen Fortschritt. Der Prozess ist vermutlich beendet oder festgefahren.';
|
||||
$data['errors'] = max(1, (int)($data['errors'] ?? 0));
|
||||
}
|
||||
|
||||
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
||||
Reference in new issue
Block a user