summaryrefslogtreecommitdiff
path: root/systray.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-09-06 10:29:30 +0200
committerRuben Pollan <meskio@sindominio.net>2018-09-06 15:45:41 +0200
commita56b1ce6018a88ee7b3c146ff8d124c56aaed974 (patch)
tree9cab16583c17b68012e1243ff256348be127764d /systray.go
parent60310f3bf825989636904da411340bec8e711e2a (diff)
[feat] check regularly the status
Don't trust that the status will be reported by openvpn/bitmaskd correctly. Let's do polling every 5 seconds.
Diffstat (limited to 'systray.go')
-rw-r--r--systray.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/systray.go b/systray.go
index 1281a77..7d24283 100644
--- a/systray.go
+++ b/systray.go
@@ -142,6 +142,13 @@ func (bt *bmTray) onReady() {
systray.Quit()
case <-signalCh:
systray.Quit()
+
+ case <-time.After(5 * time.Second):
+ if status, err := bt.bm.GetStatus(); err != nil {
+ log.Printf("Error getting status: %v", err)
+ } else {
+ bt.changeStatus(status)
+ }
}
}
}()