Nuñito Calzada
Nuñito Calzada

Reputation: 1718

Scheduler Job not called in SpringBoot app

I have this SpringBoot app:

@SpringBootApplication
@EnableScheduling
@Import({SecurityConfig.class})
public class BlogsApplication implements CommandLineRunner {
..
}

and I also have this class,

@Component 
public class UptadeCurrencyJob1 {

    @Scheduled(cron = "0 0/10 1 * * ?")
    public void reportCurrentTime() throws IOException {

            System.out.println("UptadeCurrencyJob1");       
    }
}

But it never calles

Upvotes: 0

Views: 137

Answers (1)

Antoniossss
Antoniossss

Reputation: 32550

@Scheduled(cron = "0 0/10 1 * * ?")

Indeed, this is valid cron expresion meaning that it will fire every 10 minutes past midnight (for 1 hour only). I bet you did not wait that long nor you did mean that.

Upvotes: 2

Related Questions