rdblue commented on code in PR #6562:
URL: https://github.com/apache/iceberg/pull/6562#discussion_r1084362451


##########
core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Util.java:
##########
@@ -611,17 +571,17 @@ private static AuthSession fromTokenResponse(
       AuthSession session =
           new AuthSession(
               parent.headers(), response.token(), response.issuedTokenType(), 
credential);
+
+      Long expiresAtMillis = null;
       if (response.expiresInSeconds() != null) {
-        scheduleTokenRefresh(
-            client,
-            executor,
-            session,
-            startTimeMillis,
-            response.expiresInSeconds(),
-            TimeUnit.SECONDS);
+
+        expiresAtMillis = startTimeMillis + 
TimeUnit.SECONDS.toMillis(response.expiresInSeconds());
       } else if (session.expiresAtMillis() != null) {
-        scheduleTokenRefresh(
-            client, executor, session, session.expiresAtMillis(), 
TimeUnit.MILLISECONDS);
+        expiresAtMillis = session.expiresAtMillis();

Review Comment:
   I think we should start to prefer the token's expiration if it exists. Can 
you swap the priority here?



-- 
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]

Reply via email to