mirror of
https://github.com/alex289/CleanArchitecture.git
synced 2025-08-23 19:58:34 +00:00
Add more health checks
This commit is contained in:
parent
31681617d9
commit
c72384431b
@ -7,6 +7,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="AspNetCore.HealthChecks.ApplicationStatus" Version="6.0.0" />
|
||||||
|
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="6.0.2" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.5" />
|
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.5" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.5" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5" />
|
||||||
|
@ -4,6 +4,7 @@ using CleanArchitecture.Application.gRPC;
|
|||||||
using CleanArchitecture.Domain.Extensions;
|
using CleanArchitecture.Domain.Extensions;
|
||||||
using CleanArchitecture.Infrastructure.Database;
|
using CleanArchitecture.Infrastructure.Database;
|
||||||
using CleanArchitecture.Infrastructure.Extensions;
|
using CleanArchitecture.Infrastructure.Extensions;
|
||||||
|
using HealthChecks.ApplicationStatus.DependencyInjection;
|
||||||
using HealthChecks.UI.Client;
|
using HealthChecks.UI.Client;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
|
||||||
@ -20,7 +21,9 @@ builder.Services.AddEndpointsApiExplorer();
|
|||||||
|
|
||||||
builder.Services
|
builder.Services
|
||||||
.AddHealthChecks()
|
.AddHealthChecks()
|
||||||
.AddDbContextCheck<ApplicationDbContext>();
|
.AddDbContextCheck<ApplicationDbContext>()
|
||||||
|
.AddSqlServer(builder.Configuration.GetConnectionString("DefaultConnection")!)
|
||||||
|
.AddApplicationStatus();
|
||||||
|
|
||||||
builder.Services.AddDbContext<ApplicationDbContext>(options =>
|
builder.Services.AddDbContext<ApplicationDbContext>(options =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user