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

Commit 7d81982

Browse files
committed
Run is the one that always gets called when kicking off tasks
1 parent abe70a3 commit 7d81982

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/GitHub.Api/Tasks/ActionTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public ITask Queue(ITask task)
2525
return this;
2626
}
2727

28-
public override ITask Start()
28+
protected override void Run()
2929
{
3030
foreach (var task in queuedTasks)
3131
task.Start();
32-
return base.Start();
32+
base.Run();
3333
}
3434

3535
private void TaskFinished(ITask task, bool success, Exception ex)

src/GitHub.Api/Tasks/TaskBase.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,14 +299,14 @@ public ITask Progress(Action<IProgress> handler)
299299
return this;
300300
}
301301

302-
public virtual ITask Start()
302+
public ITask Start()
303303
{
304304
var depends = GetTopMostTaskInCreatedState() ?? this;
305305
depends.Run();
306306
return this;
307307
}
308308

309-
protected void Run()
309+
protected virtual void Run()
310310
{
311311
if (Task.Status == TaskStatus.Created)
312312
{
@@ -540,6 +540,11 @@ protected TaskBase(CancellationToken token)
540540

541541
protected TaskBase(Task<TResult> task)
542542
: base()
543+
{
544+
Initialize(task);
545+
}
546+
547+
protected void Initialize(Task<TResult> task)
543548
{
544549
Task = new Task<TResult>(t =>
545550
{

0 commit comments

Comments
 (0)