Skip to content

Commit

Permalink
fx: mutex in read
Browse files Browse the repository at this point in the history
  • Loading branch information
martinsaporiti committed Oct 2, 2024
1 parent f07b643 commit 5344f71
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/loader/w3c_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ func newLocalCache() *w3CDocumentLoaderLocalCache {
}

func (c *w3CDocumentLoaderLocalCache) Get(key string) (doc *ld.RemoteDocument, expireTime time.Time, err error) {
c.mutex.RLock()
defer c.mutex.Unlock()
doc, ok := c.data[key]
if !ok {
return nil, time.Time{}, nil
Expand Down

0 comments on commit 5344f71

Please sign in to comment.