Cache: warm at array start, extend stale tolerance to 5 min, fix last uptime copy

- ARRAY_START_SCRIPTS: add api_cache_writer.sh so monitor/arrs cache is populated
  immediately on array start (/tmp is tmpfs — cleared on reboot, so first-boot
  load was hitting live API for up to 60 seconds until the cron fired)
- api/monitor.php + arrs.php: raise cache TTL from 90s to 300s — stale-but-instant
  beats a 6-second live API wait if the writer is momentarily behind
- include/unraid_api.php: replace last inline uptime formatter with vv_format_uptime()
This commit is contained in:
Gmer4Lfe
2026-06-04 16:46:50 -04:00
parent ce0b3fb74b
commit 0bcb773332
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ if ($_action === 'refresh_remote') {
unset($_action);
// ── Normal data load ──────────────────────────────────────────────────────────
$_vv_cached = vv_cache_read('arrs', 90);
$_vv_cached = vv_cache_read('arrs', 300);
if ($_vv_cached !== null) { echo json_encode($_vv_cached); exit; }
unset($_vv_cached);
+1 -1
View File
@@ -2,7 +2,7 @@
header('Content-Type: application/json');
require_once dirname(__DIR__) . '/include/config.php';
$_vv_cached = vv_cache_read('monitor', 90);
$_vv_cached = vv_cache_read('monitor', 300);
if ($_vv_cached !== null) { echo json_encode($_vv_cached); exit; }
unset($_vv_cached);