Skip to content

Commit

Permalink
Merge pull request #32580 from mkouba/quartz-shutdown-if-exists
Browse files Browse the repository at this point in the history
Quartz - only notify QuartzSchedulerImpl.destroy() if the bean exists
  • Loading branch information
mkouba committed Apr 12, 2023
2 parents ce218a7 + 9a5f479 commit 9d179ec
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import jakarta.enterprise.context.BeforeDestroyed;
import jakarta.enterprise.event.Event;
import jakarta.enterprise.event.Observes;
import jakarta.enterprise.event.Reception;
import jakarta.enterprise.inject.Instance;
import jakarta.enterprise.inject.Produces;
import jakarta.enterprise.inject.Typed;
Expand Down Expand Up @@ -466,7 +467,7 @@ void start(@Observes @Priority(Interceptor.Priority.PLATFORM_BEFORE) StartupEven
*
* @param event ignored
*/
void destroy(@Observes @BeforeDestroyed(ApplicationScoped.class) Object event) {
void destroy(@Observes(notifyObserver = Reception.IF_EXISTS) @BeforeDestroyed(ApplicationScoped.class) Object event) {
if (scheduler != null) {
try {
if (shutdownWaitTime.isZero()) {
Expand Down

0 comments on commit 9d179ec

Please sign in to comment.