Skip to content
Discussion options

You must be logged in to vote

So the ShutdownEvent is fired before the CDI container is shut down (otherwise we wouldn't be able to notify the observers) and the scheduler (in both cases, i.e. quarkus-scheduler and quarkus-quartz) is stopped when the CDI container is shut down. In other words, the @Scheduled methods are not "disabled" during the notification.

If you want to get rid of the running flag boiler plate then try to use the io.quarkus.scheduler.Scheduled.ApplicationNotRunning skip predicate, e.g. something like @Scheduled(every = "10s", skipExecutionIf = Scheduled.ApplicationNotRunning.class).

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@HerrDerb
Comment options

@mkouba
Comment options

mkouba Jan 4, 2024
Collaborator

@HerrDerb
Comment options

@HerrDerb
Comment options

@mkouba
Comment options

mkouba Jan 5, 2024
Collaborator

Answer selected by HerrDerb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants