From 40c3bc27793247fd616d0a27b3c3a0dcb4038ee1 Mon Sep 17 00:00:00 2001 From: bergware Date: Thu, 4 Jan 2024 11:47:52 +0100 Subject: [PATCH] device_list: add timeout to force update --- emhttp/plugins/dynamix/nchan/device_list | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emhttp/plugins/dynamix/nchan/device_list b/emhttp/plugins/dynamix/nchan/device_list index 6b8e15444..5176f2f3f 100755 --- a/emhttp/plugins/dynamix/nchan/device_list +++ b/emhttp/plugins/dynamix/nchan/device_list @@ -17,8 +17,7 @@ $varroot = '/var/local/emhttp'; $pool_log = '/var/tmp/pool_log.tmp'; $smartALL = '/boot/config/smart-all.cfg'; $smartONE = '/boot/config/smart-one.cfg'; -$md5_old = -1; -$fs_old = -1; +$md5_old = $fs_old = $timeout = -1; require_once "$docroot/webGui/include/Helpers.php"; require_once "$docroot/webGui/include/publish.php"; @@ -531,9 +530,11 @@ while (true) { $echo = json_encode($echo); $md5_new = md5($echo,true); - if ($md5_new !== $md5_old) { + $timeout++; + if ($md5_new !== $md5_old || $timeout >= 15) { publish('devices', $echo); $md5_old = $md5_new; + $timeout = -1; } $fs_new = _var($var,'fsState')=='Started' ? 1 : 0; if ($fs_new !== $fs_old) {