From d09a30574d35a928a8ffbd7deac1708f9f57b7c1 Mon Sep 17 00:00:00 2001 From: rsgrinko Date: Thu, 23 Dec 2021 23:39:17 +0300 Subject: [PATCH] =?UTF-8?q?[*]=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BA=D1=8D=D1=88=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boardlist.php | 10 +++++++++- users.php | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/boardlist.php b/boardlist.php index a85c06f..161aca8 100644 --- a/boardlist.php +++ b/boardlist.php @@ -57,10 +57,18 @@ foreach($arrDevices as $device): $arrUserFields = CUser::getFields($device['user']); + + $cacheId = md5('CIoT::isOnline_'.$device['id']); + if(CCache::check($cacheId) and CCache::getAge($cacheId) < DEVICE_ONLINE_TIME) { + $isDeviceOnline = CCache::get($cacheId); + } else { + $isDeviceOnline = CIoT::isOnline($device['id']); + CCache::write($cacheId, $isDeviceOnline); + } ?> - OnlineOffline + OnlineOffline diff --git a/users.php b/users.php index 420073f..89d6bd8 100644 --- a/users.php +++ b/users.php @@ -37,11 +37,21 @@ require_once __DIR__ . '/inc/header.php'; CPagination::execute($_REQUEST['page'], CUser::countUsers(), PAGINATION_LIMIT); $limit = CPagination::getLimit(); ?> - + - OnlineOffline