Skip to content

Commit

Permalink
Make sure token does not expire within 10 seconds instead of 2 (#268)
Browse files Browse the repository at this point in the history
Co-authored-by: saville <[email protected]>
  • Loading branch information
bluesliverx and saville authored Nov 17, 2023
1 parent 8dfe406 commit af8c162
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ private boolean tokenExpired() {
boolean result = true;
Calendar now = Calendar.getInstance();
long timeDiffInMillis = now.getTimeInMillis() - tokenExpiry.getTimeInMillis();
if (timeDiffInMillis < -2000L) {
// token will be valid for at least another 2s
if (timeDiffInMillis < -10000L) {

Check warning on line 65 in src/main/java/com/datapipe/jenkins/vault/credentials/AbstractVaultTokenCredentialWithExpiration.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 65 is only partially covered, one branch is missing
// token will be valid for at least another 10s
result = false;
LOGGER.log(Level.FINE, "Auth token is still valid");
} else {
Expand Down

0 comments on commit af8c162

Please sign in to comment.