Skip to content

Commit

Permalink
Improve GetOrUpdate function docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Mar 7, 2024
1 parent f42db56 commit c9ca703
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/factsengine/factscache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ func (c *FactsCache) Entries() []string {

// GetOrUpdate returns the cached result providing an entry name
// or runs the updateFunc to generate the entry.
// It locks its usage, so only one user at a time uses it
// It locks its usage for each used key, returning the same value of the
// first execution in the additional usages.
// If other function with a different key is asked, it runs in parallel
// without blocking.
func (c *FactsCache) GetOrUpdate(
entry string,
udpateFunc UpdateCacheFunc,
Expand Down

0 comments on commit c9ca703

Please sign in to comment.