feat(discord): register health check hosted service in Program.cs
Issue #32
This commit is contained in:
@@ -2,6 +2,7 @@ using GmRelay.DiscordBot;
|
|||||||
using GmRelay.DiscordBot.Features.Sessions;
|
using GmRelay.DiscordBot.Features.Sessions;
|
||||||
using GmRelay.DiscordBot.Infrastructure;
|
using GmRelay.DiscordBot.Infrastructure;
|
||||||
using GmRelay.DiscordBot.Infrastructure.Discord;
|
using GmRelay.DiscordBot.Infrastructure.Discord;
|
||||||
|
using GmRelay.DiscordBot.Infrastructure.Health;
|
||||||
using GmRelay.DiscordBot.Infrastructure.Logging;
|
using GmRelay.DiscordBot.Infrastructure.Logging;
|
||||||
using GmRelay.Shared.Features.Confirmation.HandleRsvp;
|
using GmRelay.Shared.Features.Confirmation.HandleRsvp;
|
||||||
using GmRelay.Shared.Features.Confirmation.SendConfirmation;
|
using GmRelay.Shared.Features.Confirmation.SendConfirmation;
|
||||||
@@ -73,6 +74,7 @@ builder.Services.AddSingleton<HandleRsvpHandler>();
|
|||||||
builder.Services.AddSingleton<RescheduleVotingFinalizer>();
|
builder.Services.AddSingleton<RescheduleVotingFinalizer>();
|
||||||
builder.Services.AddHostedService<SessionSchedulerService>();
|
builder.Services.AddHostedService<SessionSchedulerService>();
|
||||||
builder.Services.AddHostedService<DiscordRescheduleVotingDeadlineService>();
|
builder.Services.AddHostedService<DiscordRescheduleVotingDeadlineService>();
|
||||||
|
builder.Services.AddHostedService<DiscordHealthCheckHostedService>();
|
||||||
|
|
||||||
builder.Services
|
builder.Services
|
||||||
.AddDiscordGateway(options =>
|
.AddDiscordGateway(options =>
|
||||||
|
|||||||
@@ -87,6 +87,14 @@ public sealed class DiscordStartupTests
|
|||||||
Assert.Contains("HandleRsvpHandler", program);
|
Assert.Contains("HandleRsvpHandler", program);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Program_ShouldRegisterDiscordHealthCheckHostedService()
|
||||||
|
{
|
||||||
|
var program = ReadProgram();
|
||||||
|
Assert.Contains("DiscordHealthCheckHostedService", program);
|
||||||
|
Assert.Contains("AddHostedService<DiscordHealthCheckHostedService>", program);
|
||||||
|
}
|
||||||
|
|
||||||
private static string ReadProgram()
|
private static string ReadProgram()
|
||||||
{
|
{
|
||||||
var repoRoot = GetRepoRoot();
|
var repoRoot = GetRepoRoot();
|
||||||
|
|||||||
Reference in New Issue
Block a user