mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-28 18:06:34 +02:00
use response record version
This commit is contained in:
parent
312a440329
commit
dd62c32739
1 changed files with 3 additions and 11 deletions
|
@ -37,18 +37,10 @@ func (q *cachingQuerier) Query(ctx context.Context, in *databroker.QueryRequest,
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// If a minimum record version hint is sent, check to see if any of the records meets the minimum
|
||||
// If a minimum record version hint is sent, check to see if the result meets the minimum
|
||||
// record version and if not, invalidate the cache and re-query.
|
||||
if in.MinimumRecordVersionHint != nil {
|
||||
found := false
|
||||
for _, r := range res.GetRecords() {
|
||||
if r.GetVersion() >= *in.MinimumRecordVersionHint {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
q.InvalidateCache(ctx, in)
|
||||
}
|
||||
if in.MinimumRecordVersionHint != nil && res.RecordVersion < *in.MinimumRecordVersionHint {
|
||||
q.InvalidateCache(ctx, in)
|
||||
res, err = q.query(ctx, in, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Add table
Reference in a new issue