로그 항목 수정
This commit is contained in:
@@ -240,33 +240,32 @@ public class AccessTokenManagerByDB implements Lifecycle {
|
|||||||
|
|
||||||
SessionManager.getInstance().getOutboundAccessToken(adapterGroupName, new Function<AccessTokenVO, AccessTokenVO>() {
|
SessionManager.getInstance().getOutboundAccessToken(adapterGroupName, new Function<AccessTokenVO, AccessTokenVO>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AccessTokenVO apply(AccessTokenVO accessToken) {
|
public AccessTokenVO apply(AccessTokenVO accessToken) {
|
||||||
|
long intervalTime = System.currentTimeMillis() + (credential.getIntervalSec() * 1000);
|
||||||
long intervalTime = System.currentTimeMillis() + (credential.getIntervalSec() * 1000);
|
// // 토큰이 없거나, 다음 스케줄 시간 전에 만료될 경우 재발급
|
||||||
// // 토큰이 없거나, 다음 스케줄 시간 전에 만료될 경우 재발급
|
if (accessToken == null) {
|
||||||
if (accessToken == null) {
|
logger.debug("Token not exists for adapter group: {}", adapterGroupName);
|
||||||
return issueToken(credential);
|
return issueToken(credential);
|
||||||
} else if(accessToken.getExpiration() != null) {
|
} else if(accessToken.getExpiration() != null) {
|
||||||
// 토큰이 있고 만료시간이 설정 된 경우
|
// 토큰이 있고 만료시간이 설정 된 경우
|
||||||
if(accessToken.getExpiration().before(new Date(intervalTime))){
|
if(accessToken.getExpiration().before(new Date(intervalTime))){
|
||||||
// 다음 스케줄 전에 토큰이 만료되는 경우 재발급
|
// 다음 스케줄 전에 토큰이 만료되는 경우 재발급
|
||||||
return issueToken(credential);
|
logger.debug("Token expired : {}, expiration date: {}", adapterGroupName, accessToken.getExpiration());
|
||||||
|
return issueToken(credential);
|
||||||
|
} else {
|
||||||
|
// 토큰이 아직 유효한 경우
|
||||||
|
logger.debug("Token still valid until next schedule for adapter group: {}, expiration date: {}", adapterGroupName, accessToken.getExpiration());
|
||||||
|
return accessToken;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// 토큰이 아직 유효한 경우
|
//토큰이 있지만 만료 시간이 없는 경우
|
||||||
logger.debug("Token still valid until next schedule for adapter group: {}, expiration date: {}", adapterGroupName, accessToken.getExpiration());
|
logger.debug("Token exists but expiration time is null for adapter group: {}", adapterGroupName);
|
||||||
return accessToken;
|
return accessToken;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
//토큰이 있지만 만료 시간이 없는 경우
|
|
||||||
logger.debug("Token exists but expiration time is null for adapter group: {}", adapterGroupName);
|
|
||||||
return accessToken;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
logger.debug("Token issuance completed for adapter group: {}", adapterGroupName);
|
logger.debug("Token issuance completed for adapter group: {}", adapterGroupName);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Token issuance failed for adapter group: {}", adapterGroupName, e);
|
logger.error("Token issuance failed for adapter group: {}", adapterGroupName, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user