Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 05fd289

Browse files
Correcting TaskQueue race condition to capture success and exception
Co-Authored-By: @Joen-UnLogick <[email protected]>
1 parent e69d148 commit 05fd289

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/GitHub.Api/Tasks/ActionTask.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@ protected override void Run()
3434

3535
private void TaskFinished(ITask task, bool success, Exception ex)
3636
{
37-
var count = Interlocked.Increment(ref finishedTaskCount);
38-
isSuccessful &= success;
3937
if (!success)
38+
{
39+
isSuccessful = false;
4040
exception = ex;
41+
}
42+
var count = Interlocked.Increment(ref finishedTaskCount);
4143
if (count == queuedTasks.Count)
4244
{
4345
if (isSuccessful)

0 commit comments

Comments
 (0)