< Summary

Information
Class: Elsa.Workflows.Api.Endpoints.WorkflowDefinitions.Reload.Reload
Assembly: Elsa.Workflows.Api
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/Reload/Endpoint.cs
Line coverage
44%
Covered lines: 4
Uncovered lines: 5
Coverable lines: 9
Total lines: 28
Line coverage: 44.4%
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%
Configure()100%11100%
HandleAsync()100%210%
ReloadWorkflowDefinitionsAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowDefinitions/Reload/Endpoint.cs

#LineLine coverage
 1using Elsa.Abstractions;
 2using Elsa.Workflows.Runtime;
 3using JetBrains.Annotations;
 4
 5namespace Elsa.Workflows.Api.Endpoints.WorkflowDefinitions.Reload;
 6
 7[PublicAPI]
 18internal class Reload(IWorkflowDefinitionsReloader workflowDefinitionsReloader) : ElsaEndpointWithoutRequest
 9{
 10    private const int BatchSize = 10;
 11
 12    public override void Configure()
 13    {
 114        Post("/actions/workflow-definitions/reload");
 115        ConfigurePermissions("actions:workflow-definitions:reload");
 116    }
 17
 18    public override async Task HandleAsync(CancellationToken cancellationToken)
 19    {
 020        await ReloadWorkflowDefinitionsAsync(cancellationToken);
 021        await Send.OkAsync(cancellationToken);
 022    }
 23
 24    private async Task ReloadWorkflowDefinitionsAsync(CancellationToken cancellationToken)
 25    {
 026        await workflowDefinitionsReloader.ReloadWorkflowDefinitionsAsync(cancellationToken);
 027    }
 28}