Skip to content

Commit

Permalink
Don't cache key resolutions when cleanup interval is zero (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
segabriel authored Jan 27, 2022
1 parent 4779a86 commit 1524b1d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ public Mono<Map<String, Object>> resolve(String token) {
}

private Mono<Key> findKey(String kid, AtomicReference<Mono<Key>> computedValueHolder) {
if (cleanupInterval.isZero()) {
return Mono.defer(() -> keyProvider.findKey(kid)).cache();
}

return keyResolutions.computeIfAbsent(
kid,
(kid1) -> {
Expand Down

0 comments on commit 1524b1d

Please sign in to comment.