mirror of https://github.com/jetkvm/kvm.git
fix: wakeDisplay() doesn't need to stop the tickers
The tickers only need to be reset, if they're disabled, they won't have been started.
This commit is contained in:
parent
9896eba02a
commit
8071f81310
|
@ -162,15 +162,11 @@ func wakeDisplay(force bool) {
|
||||||
fmt.Printf("display wake failed, %s\n", err)
|
fmt.Printf("display wake failed, %s\n", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.DisplayDimAfterSec == 0 {
|
if config.DisplayDimAfterSec != 0 {
|
||||||
dimTicker.Stop()
|
|
||||||
} else {
|
|
||||||
dimTicker.Reset(time.Duration(config.DisplayDimAfterSec) * time.Second)
|
dimTicker.Reset(time.Duration(config.DisplayDimAfterSec) * time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.DisplayOffAfterSec == 0 {
|
if config.DisplayOffAfterSec != 0 {
|
||||||
offTicker.Stop()
|
|
||||||
} else {
|
|
||||||
offTicker.Reset(time.Duration(config.DisplayOffAfterSec) * time.Second)
|
offTicker.Reset(time.Duration(config.DisplayOffAfterSec) * time.Second)
|
||||||
}
|
}
|
||||||
backlightState = 0
|
backlightState = 0
|
||||||
|
|
Loading…
Reference in New Issue