agent/cache: update comment from PR review to clarify

This commit is contained in:
Mitchell Hashimoto 2018-06-04 13:39:57 -07:00 committed by Jack Pearkes
parent 424272361d
commit 6b745964c4
1 changed files with 5 additions and 1 deletions

View File

@ -367,7 +367,11 @@ func (c *Cache) fetch(t, key string, r Request, allowNew bool, attempt uint) (<-
// Increment attempt counter // Increment attempt counter
attempt++ attempt++
// Set the error that should be used if the fetch is failing. // Always set the error. We don't override the value here because
// if Valid is true, then we can reuse the Value in the case a
// specific index isn't requested. However, for blocking queries,
// we want Error to be set so that we can return early with the
// error.
newEntry.Error = err newEntry.Error = err
} }