mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user