< Summary

Information
Class: Syki.Daemon.Startup
Assembly: Daemon
File(s): /home/runner/work/syki/syki/Daemon/Startup.cs
Tag: 22_11348620282
Line coverage
100%
Covered lines: 31
Uncovered lines: 0
Coverable lines: 31
Total lines: 51
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%
ConfigureServices(...)100%11100%
Configure(...)100%11100%

File(s)

/home/runner/work/syki/syki/Daemon/Startup.cs

#LineLine coverage
 1using Hangfire;
 2using Syki.Daemon.Tasks;
 3using Syki.Daemon.Configs;
 4using Hangfire.MemoryStorage;
 5
 6namespace Syki.Daemon;
 7
 18public class Startup(IConfiguration configuration)
 9{
 10    public void ConfigureServices(IServiceCollection services)
 11    {
 112        services.AddServicesConfigs();
 13
 114        services.AddHostedService<PostgresListener>();
 15
 116        services.AddHangfire(x =>
 117        {
 118            x.UseMemoryStorage();
 119            x.UseRecommendedSerializerSettings();
 120            x.UseSimpleAssemblyNameTypeSerializer();
 221        });
 22
 123        services.AddHangfireServer(x =>
 124        {
 125            x.ServerName = "Daemon";
 126            x.SchedulePollingInterval = TimeSpan.FromSeconds(1);
 227        });
 128    }
 29
 30    public void Configure(IApplicationBuilder app)
 31    {
 132        BackgroundJob.Enqueue<SykiTasksProcessor>(x => x.Run());
 33
 134        app.UseRouting();
 135        app.UseStaticFiles();
 36
 137        app.UseEndpoints(x =>
 138        {
 139            x.MapGet("/health", () => Results.Ok(new { Status = "Healthy" }));
 240        });
 41
 142        app.UseHangfireDashboard(
 143            pathMatch: "",
 144            options: new DashboardOptions
 145            {
 146                FaviconPath = "/favicon.ico",
 147                Authorization = [ new HangfireAuthFilter(configuration.Hangfire().User, configuration.Hangfire().Passwor
 148            }
 149        );
 150    }
 51}