mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
Refactor: Support not sending duplicate messages
Keep track of the md5 within a separate function. Avoids duplication of code on the nchan scripts, and allows for the script to still exit if no listeners without adding in more code within each script to handle this.
This commit is contained in:
@@ -88,10 +88,7 @@ while (true) {
|
||||
if ($running < 1) $echo = "<tr><td colspan='7' style='text-align:center;padding-top:12px'>"._('No VMs running')."</td></tr>";
|
||||
|
||||
$echo = json_encode($echo);
|
||||
$md5_new = md5($echo,true);
|
||||
if ($md5_new !== $md5_old) {
|
||||
$md5_old = publish('vm_usage',$echo,true)!==false ? $md5_new : -1;
|
||||
}
|
||||
publish_md5('vm_usage',$echo,true);
|
||||
|
||||
sleep($timer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user