Recognos/Metrics.NET

Bug in ActionScheduler.Start(TimeSpan, Func<Task>)

Paccc opened this issue · 0 comments

Paccc commented

There is a bug in ActionScheduler.cs line 50:

Start(interval, t => t.IsCancellationRequested ? action() : TaskEx.CompletedTask);

The clauses of the if statement are reversed causing it to return a completed task if cancellation is not requested. The correct statement should be to negate the if condition:

Start(interval, t => !t.IsCancellationRequested ? action() : TaskEx.CompletedTask);