< Summary

Information
Class: Elsa.Connections.Features.ConnectionLifecycleReconciliationFeature
Assembly: Elsa.Connections
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Connections/Features/ConnectionLifecycleReconciliationFeature.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 27
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
Apply()0%4260%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Connections/Features/ConnectionLifecycleReconciliationFeature.cs

#LineLine coverage
 1using Elsa.Connections.Contracts;
 2using Elsa.Features.Abstractions;
 3using Elsa.Features.Attributes;
 4using Elsa.Features.Services;
 5using Microsoft.Extensions.DependencyInjection;
 6using Microsoft.Extensions.DependencyInjection.Extensions;
 7using Microsoft.Extensions.Hosting;
 8
 9namespace Elsa.Connections.Features;
 10
 11/// <summary>Installs the opt-in hosted credential lifecycle reconciler.</summary>
 12[DependsOn(typeof(ConnectionsFeature))]
 013public sealed class ConnectionLifecycleReconciliationFeature(IModule module) : FeatureBase(module)
 14{
 15    public override void Apply()
 16    {
 017        Services.TryAddSingleton<IConnectionLifecycleScopeProvider, EmptyConnectionLifecycleScopeProvider>();
 018        Services.AddOptions<ConnectionLifecycleReconciliationOptions>()
 019            .Validate(options => options.Interval > TimeSpan.Zero, "Interval must be positive.")
 020            .Validate(options => options.BatchSize is >= 1 and <= 500, "Batch size must be between 1 and 500.")
 021            .Validate(options => options.MaxConcurrency is >= 1 and <= 64, "Maximum concurrency must be between 1 and 64
 022            .Validate(options => options.RetryBackoff > TimeSpan.Zero && options.MaxRetryBackoff >= options.RetryBackoff
 023                "Retry backoff values are invalid.")
 024            .ValidateOnStart();
 025        Services.AddSingleton<IHostedService, ConnectionLifecycleReconciliationWorker>();
 026    }
 27}