diff --git a/core/src/main/java/io/aiven/klaw/helpers/UtilMethods.java b/core/src/main/java/io/aiven/klaw/helpers/UtilMethods.java index 0e15bb8fc3..8920e45019 100644 --- a/core/src/main/java/io/aiven/klaw/helpers/UtilMethods.java +++ b/core/src/main/java/io/aiven/klaw/helpers/UtilMethods.java @@ -92,11 +92,11 @@ public static void updateEnvStatus( public static void updateLatestStatus( ClusterStatus clusterStatus, ManageDatabase manageDatabase, int tenantId, int envId) { - LocalDateTime statusTime = LocalDateTime.now(ZoneOffset.UTC); Optional opt = manageDatabase.getEnv(tenantId, envId); if (opt.isPresent()) { Env e = opt.get(); + final LocalDateTime statusTime = LocalDateTime.now(ZoneOffset.UTC); e.setEnvStatus(clusterStatus); e.setEnvStatusTime(statusTime); e.setEnvStatusTimeString(DATE_TIME_DDMMMYYYY_HHMMSS_FORMATTER.format(statusTime));