Skip to content

Commit

Permalink
Fix the problem that not released of parallel resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidhua1996 committed Nov 18, 2024
1 parent b505001 commit 86ce76a
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,15 @@ public int subscribe(List<LaunchableExchangisTask> publishedTasks) throws Exchan
if (parallelRule.incParallel()) {
// check the status of launchedTask
// insert or update launched task, status as TaskStatus.Scheduler
boolean success = observerService.subscribe(launchableExchangisTask);
if (!success){
parallelRule.decParallel(1);
boolean success = false;
try {
success = observerService.subscribe(launchableExchangisTask);
} catch (Exception e){
throw e;
} finally {
if (!success){
parallelRule.decParallel(1);
}
}
return success;
}
Expand Down

0 comments on commit 86ce76a

Please sign in to comment.