From a70d4818a509d45e0f4447723f36e57460656f4a Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Wed, 22 Dec 2021 22:34:45 +0300 Subject: [PATCH] =?UTF-8?q?[*]=20=D1=84=D0=B8=D0=BA=D1=81=20=D0=BA=D1=8D?= =?UTF-8?q?=D1=88=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/lib/CCache.class.php | 2 +- index.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/inc/lib/CCache.class.php b/inc/lib/CCache.class.php index b9633f7..20b60b4 100644 --- a/inc/lib/CCache.class.php +++ b/inc/lib/CCache.class.php @@ -102,7 +102,7 @@ class CCache } /** - * Проверка наличия элемента в кэше + * Проверка наличия элемента в кэше с проверкой срока годности * * @param string $name Имя элемента кэша * @return bool Флаг наличия или отсутствия кэша diff --git a/index.php b/index.php index 4c1cc69..7a29232 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,8 @@ require_once __DIR__ . '/inc/bootstrap.php'; require_once __DIR__ . '/inc/header.php'; $cacheId = md5('CIoT::getDallasArrData_'.$USER['deviceId']); -if(CCache::check($cacheId)) { + +if(CCache::check($cacheId) and CCache::getAge($cacheId) < 60) { $arSensors = CCache::get($cacheId); } else { $arSensors = CIoT::getSensorsArrData($USER['deviceId']);