roryqi commented on code in PR #11155:
URL: https://github.com/apache/gravitino/pull/11155#discussion_r3272883611
##########
core/src/main/java/org/apache/gravitino/credential/CredentialCache.java:
##########
@@ -46,8 +47,13 @@ public CredentialExpireTimeCalculator(double
credentialCacheExpireRatio) {
// Set expire time after add a credential in the cache.
@Override
- public long expireAfterCreate(T key, Credential credential, long
currentTime) {
- long credentialExpireTime = credential.expireTimeInMs();
+ public long expireAfterCreate(T key, Optional<Credential> credential, long
currentTime) {
+ // Do not cache the absence of a credential, expire it immediately.
+ if (!credential.isPresent()) {
+ return 0;
+ }
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]