added healthcheks.
This commit is contained in:
parent
dd7bfb1f87
commit
66910ae6fe
@ -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
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user