File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,4 +88,4 @@ USER NetEvent
8888# run
8989WORKDIR /NetEvent
9090CMD [ "/bin/sh" , "-c" , "start-container" ]
91- HEALTHCHECK --retries=3 --timeout=10s CMD curl --fail http://localhost:5000/healthcheck || exit
91+ HEALTHCHECK --retries=3 --timeout=5s CMD curl --fail http://localhost:5000/healthcheck || exit
Original file line number Diff line number Diff line change 2727 </PackageReference >
2828 <PackageReference Include =" AspNet.Security.OpenId.Steam" Version =" 6.0.0" />
2929 <PackageReference Include =" Microsoft.Extensions.DependencyInjection.Abstractions" Version =" 6.0.0" />
30+ <PackageReference Include =" Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore" Version =" 6.0.4" />
3031 <PackageReference Include =" Microsoft.VisualStudio.Web.CodeGeneration.Design" Version =" 6.0.3" />
3132 <PackageReference Include =" Npgsql.EntityFrameworkCore.PostgreSQL" Version =" 6.0.4" />
3233 <PackageReference Include =" Swashbuckle.AspNetCore" Version =" 6.3.0" />
Original file line number Diff line number Diff line change 1212 case "sqlite" :
1313 {
1414 builder . Services . AddDbContext < ApplicationDbContext , SqliteApplicationDbContext > ( ) ;
15+ builder . Services . AddHealthChecks ( ) . AddDbContextCheck < SqliteApplicationDbContext > ( ) ;
1516 }
1617 break ;
1718 case "psql" :
1819 {
1920 builder . Services . AddDbContext < ApplicationDbContext , PsqlApplicationDbContext > ( ) ;
21+ builder . Services . AddHealthChecks ( ) . AddDbContextCheck < PsqlApplicationDbContext > ( ) ;
2022 }
2123 break ;
2224 default :
5254builder . Services . AddEndpointsApiExplorer ( ) ;
5355builder . Services . AddSwaggerGen ( ) ;
5456
55- builder . Services . AddHealthChecks ( ) ;
5657
5758var app = builder . Build ( ) ;
5859
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ services:
2222 healthcheck :
2323 test : ["CMD-SHELL", "curl --fail http://localhost:5000/healthcheck || exit"]
2424 retries : 3
25- timeout : 10s
25+ timeout : 5s
2626
2727 netevent_psql :
2828 image : ' postgres:latest'
@@ -39,7 +39,7 @@ services:
3939 healthcheck :
4040 test : ["CMD-SHELL", "pg_isready -U ${DBUser} -d ${DBName}"]
4141 retries : 3
42- timeout : 10s
42+ timeout : 5s
4343
4444networks :
4545 netevent :
You can’t perform that action at this time.
0 commit comments