From 1947730e34f404fb2a7e29e396e09df6b3c8fd68 Mon Sep 17 00:00:00 2001 From: solocla Date: Fri, 3 Jul 2026 16:48:16 +0200 Subject: [PATCH] fixed warm cache --- public/userarea/warm_cache.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/userarea/warm_cache.php b/public/userarea/warm_cache.php index 760bcabd..29365901 100644 --- a/public/userarea/warm_cache.php +++ b/public/userarea/warm_cache.php @@ -26,7 +26,8 @@ $cacheDir = __DIR__ . '/cache'; if (!is_dir($cacheDir)) mkdir($cacheDir, 0777, true); $log = []; -function warmLog(string $msg, bool $isCli) { +function warmLog(string $msg, bool $isCli) +{ global $log; $line = date('H:i:s') . " $msg"; $log[] = $line; @@ -39,7 +40,7 @@ try { // 1. Clients warmLog('[clients] Fetching...', $isCli); - $params = ['$select' => 'IdCliente,Nominativo,CodiceCliente', '$orderby' => 'Nominativo asc']; + $params = ['$select' => 'IdCliente,Nominativo,CodiceCliente,Inattivo', '$orderby' => 'Nominativo asc']; $clientData = $api->get("Cliente?" . http_build_query($params)); file_put_contents($cacheDir . '/clienti.json', json_encode($clientData)); $clientCount = count($clientData['value'] ?? []); @@ -114,7 +115,6 @@ try { $elapsed = round(microtime(true) - $startTime, 1); warmLog("Done in {$elapsed}s", $isCli); - } catch (Exception $e) { warmLog("FATAL: " . $e->getMessage(), $isCli); }