added healthcheks.

This commit is contained in:
Ruberoid 2025-07-21 13:50:11 +03:00
parent dd7bfb1f87
commit 66910ae6fe
2 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src

View File

@ -42,6 +42,7 @@ public class Startup
.WithPolling(polling => polling.WithExceptionHandler<LoggingPollingExceptionHandler>()));
services.AddTelegramBotHandling(typeof(BotClient).Assembly);
services.AddHealthChecks();
services.Configure<RebusRabbitMqOptions>(Configuration.GetSection(nameof(RebusRabbitMqOptions)));
services.AddRebus((builder, ctx) =>
builder.Transport(t =>
@ -58,6 +59,8 @@ public class Startup
public void Configure(IApplicationBuilder app)
{
app.UseHealthChecks("/health");
var bus = app.ApplicationServices.GetRequiredService<IBus>();
bus.Advanced.Topics.Subscribe("nocr.text.matcher.matched").GetAwaiter().GetResult();
}