Skip to content

Commit

Permalink
Merge pull request #2163 from arunans23/task
Browse files Browse the repository at this point in the history
Improve StartupController to delete pending tasks
  • Loading branch information
arunans23 authored Mar 20, 2024
2 parents 7b53750 + 36e8d7e commit dfc3782
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void destroy(boolean removeTask) {
}
if (synapseTaskManager.isInitialized()) {
TaskScheduler taskScheduler = synapseTaskManager.getTaskScheduler();
if (taskScheduler != null && taskScheduler.isInitialized() && removeTask) {
if (taskScheduler != null && taskScheduler.isTaskSchedulerInitialized() && removeTask) {
taskScheduler.deleteTask(taskDescription.getName(), taskDescription.getTaskGroup());
}
TaskDescriptionRepository repository = synapseTaskManager.getTaskDescriptionRepository();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ public boolean isInitialized() {
}
}

public boolean isTaskSchedulerInitialized() {
synchronized (lock) {
return initialized;
}
}

public void deleteTask(String name, String group) {
synchronized (lock) {
if (!initialized) {
Expand Down

0 comments on commit dfc3782

Please sign in to comment.