Skip to content

Commit

Permalink
Cancel without interruption of currently running tasks
Browse files Browse the repository at this point in the history
Leave potential interruption up to scheduler shutdown.

Closes spring-projectsgh-31019
  • Loading branch information
jhoeller committed Aug 9, 2023
1 parent d58e48d commit 6fc5a78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ public void postProcessBeforeDestruction(Object bean, String beanName) {
}
if (tasks != null) {
for (ScheduledTask task : tasks) {
task.cancel();
task.cancel(false);
}
}
}
Expand All @@ -595,7 +595,7 @@ public void destroy() {
Collection<Set<ScheduledTask>> allTasks = this.scheduledTasks.values();
for (Set<ScheduledTask> tasks : allTasks) {
for (ScheduledTask task : tasks) {
task.cancel();
task.cancel(false);
}
}
this.scheduledTasks.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ public Set<ScheduledTask> getScheduledTasks() {
@Override
public void destroy() {
for (ScheduledTask task : this.scheduledTasks) {
task.cancel();
task.cancel(false);
}
if (this.localExecutor != null) {
this.localExecutor.shutdownNow();
Expand Down

0 comments on commit 6fc5a78

Please sign in to comment.