2

I am scheduling a cron operation like this

@Scheduled(cron = "0 */5 11-15 * * SUN-THU", zone = "Asia/Kolkata")
public void cronner() throws ParseException {
        System.out.println("cron is running");
}

So, this means, run the job every 5 minutes from 11 am to 3 pm from Sunday to Thursday. This is working great but the problem is, it is still running after 3 pm. I am getting the log cron is running even after 3 pm. What am I doing wrong? Any help would be appreciated. Thanks

theanilpaudel
  • 3,348
  • 8
  • 39
  • 67

1 Answers1

1

I guess this works as designed. See here for example.

You specify it should run every 5 minutes for every hour that starts with 11, 12, 13, 14 or 15. So 15:55 is a perfectly fine starting time. You should not see a start after 16:00.

cmoetzing
  • 742
  • 3
  • 16