device_list: add timeout to force update

This commit is contained in:
bergware
2024-01-04 11:47:52 +01:00
parent 5effac6e9e
commit 40c3bc2779

View File

@@ -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) {