Browse Source

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

while the goroutine is running
master
Elis Hirwing 2 years ago
parent
commit
1e50b13b76
Signed by: etu <elis@hirwing.se> GPG Key ID: D57EFA625C9A925F
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/statusscreen/SL.go

+ 2
- 1
src/statusscreen/SL.go View File

@@ -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