Fix fetcher flag usage misplacement.
This commit is contained in:
parent
afad4f5d7f
commit
de5b55da43
@ -19,6 +19,10 @@ func (a *Application) fetch() {
|
||||
return
|
||||
}
|
||||
|
||||
a.fetchIsRunningMutex.Lock()
|
||||
a.fetchIsRunning = true
|
||||
a.fetchIsRunningMutex.Unlock()
|
||||
|
||||
log.Println("Fetching data for", a.name)
|
||||
|
||||
req, err := http.NewRequestWithContext(a.ctx, "GET", a.config.Endpoint, nil)
|
||||
@ -52,10 +56,6 @@ func (a *Application) fetch() {
|
||||
|
||||
a.storage.Put(data)
|
||||
|
||||
a.fetchIsRunningMutex.Lock()
|
||||
a.fetchIsRunning = true
|
||||
a.fetchIsRunningMutex.Unlock()
|
||||
|
||||
a.fetchIsRunningMutex.Lock()
|
||||
a.fetchIsRunning = false
|
||||
a.fetchIsRunningMutex.Unlock()
|
||||
|
Loading…
Reference in New Issue
Block a user