< Summary

Information
Class: Elsa.Workflows.Runtime.StoreWorkflowExecutionLogSink
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Services/StoreWorkflowExecutionLogSink.cs
Line coverage
85%
Covered lines: 6
Uncovered lines: 1
Coverable lines: 7
Total lines: 24
Line coverage: 85.7%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
PersistExecutionLogsAsync()50%2283.33%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Services/StoreWorkflowExecutionLogSink.cs

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2using Elsa.Workflows.Runtime.Entities;
 3using Elsa.Workflows.Runtime.Notifications;
 4using Open.Linq.AsyncExtensions;
 5
 6namespace Elsa.Workflows.Runtime;
 7
 8/// <summary>
 9/// This implementation saves <see cref="WorkflowExecutionLogRecord"/> directly through the store.
 10/// </summary>
 43711public class StoreWorkflowExecutionLogSink(IWorkflowExecutionLogStore store, ILogRecordExtractor<WorkflowExecutionLogRec
 12{
 13    /// <inheritdoc />
 14    public async Task PersistExecutionLogsAsync(WorkflowExecutionContext context, CancellationToken cancellationToken)
 15    {
 46616        var records = await extractor.ExtractLogRecordsAsync(context).ToList();
 17
 46618        if(records.Count == 0)
 019            return;
 20
 46621        await store.AddManyAsync(records, context.CancellationToken);
 46622        await notificationSender.SendAsync(new WorkflowExecutionLogUpdated(context), context.CancellationToken);
 46623    }
 24}