< Summary - Estud

Information
Class: Estud.Back.Configs.QuartzConfigs
Assembly: Back
File(s): /home/runner/work/syki/syki/Back/Configs/QuartzConfigs.cs
Tag: 114_29044117136
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 34
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
AddQuartzConfigs(...)100%44100%

File(s)

/home/runner/work/syki/syki/Back/Configs/QuartzConfigs.cs

#LineLine coverage
 1using Quartz;
 2using Estud.Back.Webhooks;
 3
 4namespace Estud.Back.Configs;
 5
 6public static class QuartzConfigs
 7{
 8    public static void AddQuartzConfigs(this WebApplicationBuilder builder)
 9    {
 210        var commands = builder.Configuration.Jobs.CommandsPollingIntervalInSeconds;
 211        var webhookCalls = builder.Configuration.Jobs.WebhookCallsPollingIntervalInSeconds;
 12
 213        builder.Services.AddQuartz(q =>
 214        {
 215            var commandsId = nameof(CommandsProcessor);
 416            q.AddJob<CommandsProcessor>(j => j.WithIdentity(commandsId));
 417            q.AddTrigger(t => t
 418                .ForJob(commandsId)
 419                .WithIdentity($"{commandsId}-trigger")
 420                .WithSimpleSchedule(s => s.WithIntervalInSeconds(commands).RepeatForever())
 221            );
 222
 223            var webhookCallsId = nameof(PendingWebhookCallsProcessor);
 424            q.AddJob<PendingWebhookCallsProcessor>(j => j.WithIdentity(webhookCallsId));
 425            q.AddTrigger(t => t
 426                .ForJob(webhookCallsId)
 427                .WithIdentity($"{webhookCallsId}-trigger")
 428                .WithSimpleSchedule(s => s.WithIntervalInSeconds(webhookCalls).RepeatForever())
 229            );
 430        });
 31
 432        builder.Services.AddQuartzHostedService(q => q.WaitForJobsToComplete = true);
 233    }
 34}