mirror of https://github.com/jetkvm/kvm.git
chore: fix some start-up timing issues
This commit is contained in:
parent
6445628114
commit
f5035f28c9
|
@ -210,7 +210,7 @@ func watchTsEvents() {
|
||||||
func startBacklightTickers() {
|
func startBacklightTickers() {
|
||||||
LoadConfig()
|
LoadConfig()
|
||||||
if dimTicker == nil && config.DisplayDimAfterSec != 0 {
|
if dimTicker == nil && config.DisplayDimAfterSec != 0 {
|
||||||
fmt.Printf("display: dim_ticker has started.")
|
fmt.Printf("display: dim_ticker has started\n")
|
||||||
dimTicker = time.NewTicker(time.Duration(config.DisplayDimAfterSec) * time.Second)
|
dimTicker = time.NewTicker(time.Duration(config.DisplayDimAfterSec) * time.Second)
|
||||||
defer dimTicker.Stop()
|
defer dimTicker.Stop()
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ func startBacklightTickers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if offTicker == nil && config.DisplayOffAfterSec != 0 {
|
if offTicker == nil && config.DisplayOffAfterSec != 0 {
|
||||||
fmt.Printf("display: off_ticker has started.")
|
fmt.Printf("display: off_ticker has started\n")
|
||||||
offTicker = time.NewTicker(time.Duration(config.DisplayOffAfterSec) * time.Second)
|
offTicker = time.NewTicker(time.Duration(config.DisplayOffAfterSec) * time.Second)
|
||||||
defer offTicker.Stop()
|
defer offTicker.Stop()
|
||||||
|
|
||||||
|
@ -243,14 +243,14 @@ func startBacklightTickers() {
|
||||||
func init() {
|
func init() {
|
||||||
go func() {
|
go func() {
|
||||||
waitCtrlClientConnected()
|
waitCtrlClientConnected()
|
||||||
|
startBacklightTickers()
|
||||||
fmt.Println("setting initial display contents")
|
fmt.Println("setting initial display contents")
|
||||||
time.Sleep(500 * time.Millisecond)
|
time.Sleep(500 * time.Millisecond)
|
||||||
updateStaticContents()
|
updateStaticContents()
|
||||||
displayInited = true
|
displayInited = true
|
||||||
fmt.Println("display inited")
|
fmt.Println("display inited")
|
||||||
wakeDisplay(false)
|
wakeDisplay(true)
|
||||||
requestDisplayUpdate()
|
requestDisplayUpdate()
|
||||||
startBacklightTickers()
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go watchTsEvents()
|
go watchTsEvents()
|
||||||
|
|
Loading…
Reference in New Issue