Cron issue between every minute setup and specific time setup

28 Views Asked by At

In one program having testing cron we have different behaviour. In both cases we run a log or sysout function.

First syntax is to run every minute:

    @Scheduled (cron = "0 * * * * ?")
public void getDataTest(){
    System.out.println("TEST");
}

Second is at a specific minutes and hour every day:

@Scheduled (cron = "0 22 14 * * ?")
public void getDataTestTwo(){
    System.out.println("TEST getDataTestTwo");
}

The setup is with six field at 0 seconds which is the first value.

The first test is running normally at every minute the second is not running either if reset this after 5 minutes and restart the program.

What could be the reason.

In the main application class we have @enableScheduling annotation. Though it is clear the cron is working cause of 1st case.

0

There are 0 best solutions below