< Summary

Information
Class: Elsa.Workflows.Runtime.Handlers.DeleteWorkflowExecutionLogRecords
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Handlers/DeleteWorkflowExecutionLogRecords.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 34
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
HandleAsync()100%11100%
DeleteManyAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Handlers/DeleteWorkflowExecutionLogRecords.cs

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2using Elsa.Workflows.Management.Notifications;
 3using Elsa.Workflows.Runtime.Filters;
 4using JetBrains.Annotations;
 5
 6namespace Elsa.Workflows.Runtime.Handlers;
 7
 8/// <summary>
 9/// Deletes workflow execution log records in response to the <see cref="WorkflowInstancesDeleting"/> notification.
 10/// </summary>
 11[PublicAPI]
 12internal class DeleteWorkflowExecutionLogRecords : INotificationHandler<WorkflowInstancesDeleting>
 13{
 14    private readonly IWorkflowExecutionLogStore _store;
 15
 16    /// <summary>
 17    /// Initializes a new instance of the <see cref="DeleteWorkflowExecutionLogRecords"/> class.
 18    /// </summary>
 46719    public DeleteWorkflowExecutionLogRecords(IWorkflowExecutionLogStore store)
 20    {
 46721        _store = store;
 46722    }
 23
 24    /// <inheritdoc />
 25    public async Task HandleAsync(WorkflowInstancesDeleting notification, CancellationToken cancellationToken)
 26    {
 1327        await DeleteManyAsync(new WorkflowExecutionLogRecordFilter { WorkflowInstanceIds = notification.Ids }, cancellat
 1328    }
 29
 30    private async Task DeleteManyAsync(WorkflowExecutionLogRecordFilter filter, CancellationToken cancellationToken = de
 31    {
 1332        await _store.DeleteManyAsync(filter, cancellationToken);
 1333    }
 34}