From 35669bae3969f8fe107631d2a970901a71ef3687 Mon Sep 17 00:00:00 2001 From: nisha Date: Thu, 28 Nov 2024 12:42:20 +0530 Subject: [PATCH] Update code --- .../ApplicationEvaluationScheduler.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/gepafin/tendermanagement/scheduler/ApplicationEvaluationScheduler.java b/src/main/java/net/gepafin/tendermanagement/scheduler/ApplicationEvaluationScheduler.java index 94980dcd..a0444349 100644 --- a/src/main/java/net/gepafin/tendermanagement/scheduler/ApplicationEvaluationScheduler.java +++ b/src/main/java/net/gepafin/tendermanagement/scheduler/ApplicationEvaluationScheduler.java @@ -40,8 +40,16 @@ public class ApplicationEvaluationScheduler { @Scheduled(cron = "0 0 2 * * ?") // Runs daily at midnight public void updateExpiredEvaluations() { log.info("Starting the Application Evaluation Expiration scheduler..."); - Utils.setHttpServletRequestForScheduler(); try { + + Utils.setHttpServletRequestForScheduler(); + + // Logging user action for the scheduler operation + loggingUtil.logUserActionWithoutToken( + UserActionRequest.builder().request(httpServletRequest).actionType(UserActionLogsEnum.SCHEDULER) + .actionContext(UserActionContextEnum.EVALUATION_EXPIRATION_SCHEDULER).build()); + + processExpiredEvaluation(); log.info("Completed the process of updating expiring application evaluations."); } catch (Exception e) { @@ -55,11 +63,7 @@ public class ApplicationEvaluationScheduler { private void processExpiredEvaluation() { log.info("Starting the process of expiring application evaluations."); - // Logging user action for the scheduler operation - loggingUtil.logUserActionWithoutToken( - UserActionRequest.builder().request(httpServletRequest).actionType(UserActionLogsEnum.SCHEDULER) - .actionContext(UserActionContextEnum.EVALUATION_EXPIRATION_SCHEDULER).build()); - + try { List evaluations = applicationEvaluationRepository .findAllByIsDeletedFalseAndEndDateBefore(