Fix timer usage for monitor check update
This commit is contained in:
parent
8bfb64cf04
commit
cddf60537d
1 changed files with 4 additions and 3 deletions
|
|
@ -72,10 +72,11 @@ func (m *defaultInterfaceMonitor) Start() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *defaultInterfaceMonitor) delayCheckUpdate() {
|
func (m *defaultInterfaceMonitor) delayCheckUpdate() {
|
||||||
if m.checkUpdateTimer != nil {
|
if m.checkUpdateTimer == nil {
|
||||||
m.checkUpdateTimer.Stop()
|
|
||||||
}
|
|
||||||
m.checkUpdateTimer = time.AfterFunc(time.Second, m.postCheckUpdate)
|
m.checkUpdateTimer = time.AfterFunc(time.Second, m.postCheckUpdate)
|
||||||
|
} else {
|
||||||
|
m.checkUpdateTimer.Reset(time.Second)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *defaultInterfaceMonitor) postCheckUpdate() {
|
func (m *defaultInterfaceMonitor) postCheckUpdate() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue