-
Notifications
You must be signed in to change notification settings - Fork 583
Description
Helidon Version: V4 (latest)
Enhancement Description
As per existing documentation (https://helidon.io/docs/v4/mp/scheduling), there is no option to disable the scheduling based on configuration property (eg. schedule.enabled: false) during the application startup, like in other frameworks (Spring: @scheduled(cron = Scheduled.CRON_DISABLED).
I'm aware of the workaround of configuring the cron values in a way that the execution are delayed / or never executes:
cron: "0 0 0 ? 12 7 2099" or cron: "0 0 0 31 2 ?":
com.example.mp.app.init:
schedule:
cron: "0 0 0 31 2 ?"
but in my opinion this is misleading for a production environment as the the scope of setting a cron is for the scheduler to execute at that specific date, not the opposite.
Solution (more intuitive):
application.yaml
com.example.mp.app.init:
schedule:
enabled: false
Similar approach is used for other capabilities in Helidon: e.g. metrics.enabled: false
Thanks,
Adrian
Metadata
Metadata
Assignees
Labels
Type
Projects
Status