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 418ed161dc
commit bb98686ec8
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
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
}