rdblue commented on code in PR #6562:
URL: https://github.com/apache/iceberg/pull/6562#discussion_r1084357811
##########
core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Util.java:
##########
@@ -550,31 +512,29 @@ public static AuthSession fromAccessToken(
RESTClient client,
ScheduledExecutorService executor,
String token,
- Long defaultExpiresInMillis,
+ Long defaultExpiresAtMillis,
AuthSession parent) {
AuthSession session =
new AuthSession(
parent.headers(), token, OAuth2Properties.ACCESS_TOKEN_TYPE,
parent.credential());
- long startTimeMillis = System.currentTimeMillis();
- Long expiresAtMillis = session.expiresAtMillis();
+ Long expiresAtMillis = null;
- if (isExpired(expiresAtMillis, startTimeMillis)) {
+ if (session.expiresAtMillis() != null
+ && session.expiresAtMillis() <= System.currentTimeMillis()) {
Review Comment:
Why did you change the use of `expiresAtMillis`? Now there are 4 calls to
`session.expiresAtMillis()` rather than using a variable.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]