< Summary

Information
Class: Elsa.Resilience.Handlers.PropagateRetryAttemptedFlag
Assembly: Elsa.Resilience
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Resilience/Handlers/PropagateRetryAttemptedFlag.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 20
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
HandleAsync(...)100%22100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Resilience/Handlers/PropagateRetryAttemptedFlag.cs

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2using Elsa.Resilience.Extensions;
 3using Elsa.Workflows.Runtime.Notifications;
 4using JetBrains.Annotations;
 5
 6namespace Elsa.Resilience.Handlers;
 7
 8[UsedImplicitly]
 9public class PropagateRetryAttemptedFlag : INotificationHandler<BackgroundActivityExecutionCompleted>
 10{
 11    public Task HandleAsync(BackgroundActivityExecutionCompleted notification, CancellationToken cancellationToken)
 12    {
 2013        var hasRetries = notification.ActivityExecutionContext.GetRetriesAttemptedFlag();
 14
 2015        if (hasRetries)
 116            notification.ActivityExecutionContext.SetRetriesAttemptedFlag(); // Propagates the flag to all ancestors.
 17
 2018        return Task.CompletedTask;
 19    }
 20}