fix: the screen doesn't dim or turn off

* Fix for #531

Fix for https://github.com/jetkvm/kvm/issues/531

* typo

* Skip processing if lease hasn't changed to avoid unnecessary wake-ups

* Add comment to clarify the need to stop the tickers
This commit is contained in:
Alex Ballas
2025-06-03 02:28:14 +03:00
committed by GitHub
parent 8d77d75294
commit a7693df92c
2 changed files with 18 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"os"
"path/filepath"
"reflect"
"time"
"github.com/fsnotify/fsnotify"
@@ -149,6 +150,12 @@ func (c *DHCPClient) loadLeaseFile() error {
}
isFirstLoad := c.lease == nil
// Skip processing if lease hasn't changed to avoid unnecessary wake-ups.
if reflect.DeepEqual(c.lease, lease) {
return nil
}
c.lease = lease
if lease.IPAddress == nil {