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

while the goroutine is running
master
Elis Hirwing 6 years ago
parent 87e6ba7adf
commit 1e50b13b76
Signed by: etu
GPG Key ID: D57EFA625C9A925F

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