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
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||||
WORKDIR /app
|
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
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|||||||
@ -42,6 +42,7 @@ public class Startup
|
|||||||
.WithPolling(polling => polling.WithExceptionHandler<LoggingPollingExceptionHandler>()));
|
.WithPolling(polling => polling.WithExceptionHandler<LoggingPollingExceptionHandler>()));
|
||||||
services.AddTelegramBotHandling(typeof(BotClient).Assembly);
|
services.AddTelegramBotHandling(typeof(BotClient).Assembly);
|
||||||
|
|
||||||
|
services.AddHealthChecks();
|
||||||
services.Configure<RebusRabbitMqOptions>(Configuration.GetSection(nameof(RebusRabbitMqOptions)));
|
services.Configure<RebusRabbitMqOptions>(Configuration.GetSection(nameof(RebusRabbitMqOptions)));
|
||||||
services.AddRebus((builder, ctx) =>
|
services.AddRebus((builder, ctx) =>
|
||||||
builder.Transport(t =>
|
builder.Transport(t =>
|
||||||
@ -58,6 +59,8 @@ public class Startup
|
|||||||
|
|
||||||
public void Configure(IApplicationBuilder app)
|
public void Configure(IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
|
app.UseHealthChecks("/health");
|
||||||
|
|
||||||
var bus = app.ApplicationServices.GetRequiredService<IBus>();
|
var bus = app.ApplicationServices.GetRequiredService<IBus>();
|
||||||
bus.Advanced.Topics.Subscribe("nocr.text.matcher.matched").GetAwaiter().GetResult();
|
bus.Advanced.Topics.Subscribe("nocr.text.matcher.matched").GetAwaiter().GetResult();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user