mirror of
https://github.com/status-im/consul.git
synced 2025-02-18 08:36:46 +00:00
submatview: improve a couple comments
This commit is contained in:
parent
eb4f8b17e9
commit
c94eaa4957
@ -30,7 +30,7 @@ type Store struct {
|
|||||||
|
|
||||||
// idleTTL is the duration of time an entry should remain in the Store after the
|
// idleTTL is the duration of time an entry should remain in the Store after the
|
||||||
// last request for that entry has been terminated. It is a field on the struct
|
// last request for that entry has been terminated. It is a field on the struct
|
||||||
// so that it can be patched in tests without need a lock.
|
// so that it can be patched in tests without needing a global lock.
|
||||||
idleTTL time.Duration
|
idleTTL time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,8 +122,8 @@ func (s *Store) Get(ctx context.Context, req Request) (Result, error) {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
result, err := materializer.getFromView(ctx, info.MinIndex)
|
result, err := materializer.getFromView(ctx, info.MinIndex)
|
||||||
// context.DeadlineExceeded is translated to nil to match the behaviour of
|
// context.DeadlineExceeded is translated to nil to match the timeout
|
||||||
// agent/cache.Cache.Get.
|
// behaviour of agent/cache.Cache.Get.
|
||||||
if err == nil || errors.Is(err, context.DeadlineExceeded) {
|
if err == nil || errors.Is(err, context.DeadlineExceeded) {
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user