mirror of https://github.com/status-im/consul.git
agent/cache: update comment from PR review to clarify
This commit is contained in:
parent
424272361d
commit
6b745964c4
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue