chore: reduce logging
This commit is contained in:
parent
c79c73a189
commit
aa2eed5a47
2 changed files with 11 additions and 2 deletions
|
|
@ -1792,8 +1792,10 @@ func (lp *Loadpoint) startWakeUpTimer() {
|
||||||
|
|
||||||
// stopWakeUpTimer stops wakeUpTimer
|
// stopWakeUpTimer stops wakeUpTimer
|
||||||
func (lp *Loadpoint) stopWakeUpTimer() {
|
func (lp *Loadpoint) stopWakeUpTimer() {
|
||||||
lp.log.DEBUG.Printf("wake-up timer: stop")
|
if lp.wakeUpTimer.Running() {
|
||||||
lp.wakeUpTimer.Stop()
|
lp.log.DEBUG.Printf("wake-up timer: stop")
|
||||||
|
lp.wakeUpTimer.Stop()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (lp *Loadpoint) shouldBeConsistent() bool {
|
func (lp *Loadpoint) shouldBeConsistent() bool {
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,13 @@ func (m *Timer) Stop() {
|
||||||
m.started = time.Time{}
|
m.started = time.Time{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Timer) Running() bool {
|
||||||
|
m.Lock()
|
||||||
|
defer m.Unlock()
|
||||||
|
|
||||||
|
return !m.started.IsZero()
|
||||||
|
}
|
||||||
|
|
||||||
// Elapsed checks if the timer has elapsed and if resets its status
|
// Elapsed checks if the timer has elapsed and if resets its status
|
||||||
func (m *Timer) Elapsed() WakeUpEvent {
|
func (m *Timer) Elapsed() WakeUpEvent {
|
||||||
m.Lock()
|
m.Lock()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue