How to conditionally enable or disable scheduled jobs in Spring?

前端 未结 11 1418
轻奢々
轻奢々 2020-11-28 07:26

I am defining scheduled jobs with cron style patterns in Spring, using the @Scheduled annotation.

The cron pattern is stored in a config properties file

11条回答
  •  不知归路
    2020-11-28 07:55

    I know my answer is a hack, but giving a valid cron expression that never executes may fix the issue (in the environment specific configuration), Quartz: Cron expression that will never execute

提交回复
热议问题