< Summary

Information
Class: Elsa.Workflows.Runtime.Handlers.InvalidateWorkflowsCache
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Handlers/InvalidateWorkflowsCache.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 24
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
.ctor(...)100%11100%
HandleAsync()100%22100%

File(s)

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

#LineLine coverage
 1using Elsa.Mediator.Contracts;
 2using Elsa.Workflows.Management;
 3using Elsa.Workflows.Runtime.Notifications;
 4using JetBrains.Annotations;
 5
 6namespace Elsa.Workflows.Runtime.Handlers;
 7
 8/// <summary>
 9/// A notification handler that invalidates the workflow cache when workflow definitions are reloaded.
 10/// </summary>
 11/// <remarks>
 12/// The class implements the <c>INotificationHandler</c> interface and is responsible for handling <c>WorkflowDefinition
 13/// When a <c>WorkflowDefinitionsReloaded</c> notification is received, the <c>HandleAsync</c> method is called to inval
 14/// </remarks>
 15[UsedImplicitly]
 31916public class InvalidateWorkflowsCache(IWorkflowDefinitionCacheManager workflowDefinitionCacheManager) : INotificationHan
 17{
 18    /// <inheritdoc />
 19    public async Task HandleAsync(WorkflowDefinitionsReloaded notification, CancellationToken cancellationToken)
 20    {
 87621        foreach (var reloadedWorkflowDefinition in notification.ReloadedWorkflowDefinitions)
 43222            await workflowDefinitionCacheManager.EvictWorkflowDefinitionAsync(reloadedWorkflowDefinition.DefinitionId, c
 623    }
 24}