Fetch SL data in a goroutine, but also make sure to not spam them
while the goroutine is runningmaster
parent
87e6ba7adf
commit
1e50b13b76
|
@ -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…
Reference in New Issue