Skip to content

Commit

Permalink
return instead of if ! for spring-guides#30
Browse files Browse the repository at this point in the history
  • Loading branch information
glelouet committed May 25, 2024
1 parent ec02ae8 commit e30ee71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/com/example/schedulingtasks/ScheduledTasks.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}

0 comments on commit e30ee71

Please sign in to comment.