From 6a9581ba69b2742b78cfcd8bd695851a39acc65e Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Fri, 14 Jan 2022 23:39:02 +0300 Subject: [PATCH] small fix --- inc/lib/CIoT.class.php | 2 +- index.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/lib/CIoT.class.php b/inc/lib/CIoT.class.php index b2cbbe8..bef9ceb 100644 --- a/inc/lib/CIoT.class.php +++ b/inc/lib/CIoT.class.php @@ -173,7 +173,7 @@ class CIoT { * @param $deviceId */ public static function getSensorAllData($deviceId){ - for($i=1; $i<11; $i++) { + for($i=1; $i<5; $i++) { $res = self::$DB->query('SELECT * FROM sensors WHERE device="'.$deviceId.'" and sensor="ds'.($i).'" ORDER BY id DESC LIMIT 1'); if($res) { $result['ds'.$i]['sensor'] = $res[0]['sensor']; diff --git a/index.php b/index.php index 5614c30..e0b6d05 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ require_once __DIR__ . '/inc/bootstrap.php'; require_once __DIR__ . '/inc/header.php'; -$cacheId = md5('CIoT::getDallasArrData_'.$USER['deviceId']); +$cacheId = md5('CIoT::getSensorsArrData_'.$USER['deviceId']); if(CCache::check($cacheId) and CCache::getAge($cacheId) < 60) { $arSensors = CCache::get($cacheId); @@ -70,7 +70,7 @@ if(CCache::check($cacheId) and CCache::getAge($cacheId) < 60) { }, dataType: "json" }); - }, 3000); + }, 30000); });