Skip to content

Commit

Permalink
Fixing logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ark2307 committed Nov 22, 2024
1 parent 6ea05d7 commit 4559264
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public String intercept(ActionInvocation invocation) throws Exception {
int timeNow = Context.now();
try {
HttpServletRequest request = ServletActionContext.getRequest();
logger.info("Entered at: " + timeNow);
if(featureLabel == null) {
throw new Exception("Feature list is null or empty");
}
Expand All @@ -87,26 +86,28 @@ public String intercept(ActionInvocation invocation) throws Exception {
throw new Exception("User not found in session, returning from interceptor");
}
int sessionAccId = getUserAccountId(session);
timeNow = Context.now();

logger.info("Found sessionId in : " + (Context.now() - timeNow));
timeNow = Context.now();


if(!DashboardMode.isMetered()){
return invocation.invoke();
}

timeNow = Context.now();

if(!(UsageMetricCalculator.isRbacFeatureAvailable(sessionAccId) || featureLabel.equalsIgnoreCase(RbacEnums.Feature.ADMIN_ACTIONS.toString()))){
logger.info("Time by feature label check in: " + (Context.now() - timeNow));
return invocation.invoke();
}

logger.info("Time by feature label check in: " + (Context.now() - timeNow));
timeNow = Context.now();
loggerMaker.infoAndAddToDb("Found user in interceptor: " + user.getLogin(), LogDb.DASHBOARD);

loggerMaker.infoAndAddToDb("Found user in interceptor: " + user.getLogin(), LogDb.DASHBOARD);
int userId = user.getId();

Role userRoleRecord = RBACDao.getCurrentRoleForUser(userId, sessionAccId);
logger.info("Found user role in: " + (Context.now() - timeNow));
String userRole = userRoleRecord != null ? userRoleRecord.getName().toUpperCase() : "";

if(userRole == null || userRole.isEmpty()) {
Expand Down

0 comments on commit 4559264

Please sign in to comment.