Java Spring @Scheduled tasks executing twice

前端 未结 23 1545
清歌不尽
清歌不尽 2020-11-29 09:07

I have a simple test method here that is set to run every 5 seconds and it does, but looking at the System.out you can see it appears to be doing something odd.



        
23条回答
  •  有刺的猬
    2020-11-29 09:45

    In the application.properties, add the following property which tells the Spring Boot Application to not start the Batch Job on Application startup.

    spring.batch.job.enabled=false
    

提交回复
热议问题