Skip to content

Commit

Permalink
Merge pull request #1154 from ricado-group/1153-semaphore-disposed-ex…
Browse files Browse the repository at this point in the history
…ception

Fix for #1153 - Semaphore disposed before discarded tasks have finished

(cherry picked from commit 0c95330)
  • Loading branch information
michaelklishin authored and lukebakken committed Feb 23, 2022
1 parent 3365ff6 commit 78d6053
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,14 @@ private static async Task HandleConcurrent(Work work, IModel model, SemaphoreSli
finally
{
work.PostExecute();
limiter.Release();

try
{
limiter.Release();
}
catch (ObjectDisposedException) // Prevents Exceptions in the Task's finalizer when the WorkPool is Stopped
{
}
}
}

Expand Down

0 comments on commit 78d6053

Please sign in to comment.