Fetch SL data in a goroutine, but also make sure to not spam them

while the goroutine is running
master
Elis Hirwing 5 years ago
parent 87e6ba7adf
commit 1e50b13b76
Signed by: etu
GPG Key ID: D57EFA625C9A925F
  1. 3
      src/statusscreen/SL.go

@ -58,7 +58,8 @@ func (sl *SL) GetOutput() []string {
// Check if it's time to refresh yet
if sl.nextRefresh <= time.Now().Unix() {
sl.getData()
sl.nextRefresh += 10
go sl.getData()
}
for _, v := range sl.lastResponse.ResponseData.Metros {

Loading…
Cancel
Save