diff --git a/src/main/java/com/example/schedulingtasks/ScheduledTasks.java b/src/main/java/com/example/schedulingtasks/ScheduledTasks.java index fb1177d..58f99fb 100644 --- a/src/main/java/com/example/schedulingtasks/ScheduledTasks.java +++ b/src/main/java/com/example/schedulingtasks/ScheduledTasks.java @@ -42,8 +42,9 @@ public void reportCurrentTime() { @Scheduled(fixedRateString = "${my.app.time.report.cycle:8000}", initialDelayString = "${my.app.time.report.delay:0}") public void reportCurrentTimeParametered() { - if (!skipReportTime) { - log.info("[parametered] The time is now {}", dateFormat.format(new Date())); + if (skipReportTime) { + return; } + log.info("[parametered] The time is now {}", dateFormat.format(new Date())); } }