Skip to content

Commit

Permalink
fix: remove optimistic cache check to prevent data race
Browse files Browse the repository at this point in the history
Signed-off-by: Jakob Steiner <[email protected]>
  • Loading branch information
kosmoz authored and christophenne committed Jun 3, 2024
1 parent d7ff2d8 commit 298e8f5
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions internal/repo/client/defaultclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ func (c *defaultClient) fetchYAMLOrJSON(url string, target any) error {
}
}

if cached.updated.Add(c.maxCacheAge).After(time.Now()) {
if c.debug {
fmt.Fprintln(os.Stderr, "cache hit", url)
}
return yaml.Unmarshal(cached.bytes, target)
}

cached.mutex.Lock()
defer cached.mutex.Unlock()

Expand Down

0 comments on commit 298e8f5

Please sign in to comment.