@@ -54,16 +54,21 @@ public void ConfigureServices(IServiceCollection services)
5454
5555 services . AddHealthChecks ( checks =>
5656 {
57- checks . AddUrlCheck ( Configuration [ "CatalogUrl" ] ) ;
58- checks . AddUrlCheck ( Configuration [ "OrderingUrl" ] ) ;
59- checks . AddUrlCheck ( Configuration [ "BasketUrl" ] ) ;
60- checks . AddUrlCheck ( Configuration [ "IdentityUrl" ] ) ;
57+ var minutes = 1 ;
58+ if ( int . TryParse ( Configuration [ "HealthCheck:Timeout" ] , out var minutesParsed ) )
59+ {
60+ minutes = minutesParsed ;
61+ }
62+ checks . AddUrlCheck ( Configuration [ "CatalogUrl" ] , TimeSpan . FromMinutes ( minutes ) ) ;
63+ checks . AddUrlCheck ( Configuration [ "OrderingUrl" ] , TimeSpan . FromMinutes ( minutes ) ) ;
64+ checks . AddUrlCheck ( Configuration [ "BasketUrl" ] , TimeSpan . FromMinutes ( minutes ) ) ;
65+ checks . AddUrlCheck ( Configuration [ "IdentityUrl" ] , TimeSpan . FromMinutes ( minutes ) ) ;
6166 } ) ;
6267
6368 // Add application services.
64- services . AddSingleton < IHttpContextAccessor , HttpContextAccessor > ( ) ;
65- services . AddTransient < ICatalogService , CatalogService > ( ) ;
66- services . AddTransient < IOrderingService , OrderingService > ( ) ;
69+ services . AddSingleton < IHttpContextAccessor , HttpContextAccessor > ( ) ;
70+ services . AddTransient < ICatalogService , CatalogService > ( ) ;
71+ services . AddTransient < IOrderingService , OrderingService > ( ) ;
6772 services . AddTransient < IBasketService , BasketService > ( ) ;
6873 services . AddTransient < IIdentityParser < ApplicationUser > , IdentityParser > ( ) ;
6974
@@ -76,7 +81,7 @@ public void ConfigureServices(IServiceCollection services)
7681 {
7782 services . AddSingleton < IHttpClient , StandardHttpClient > ( ) ;
7883 }
79- }
84+ }
8085
8186 // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
8287 public void Configure ( IApplicationBuilder app , IHostingEnvironment env , ILoggerFactory loggerFactory )
@@ -113,10 +118,10 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
113118 AuthenticationScheme = "oidc" ,
114119 SignInScheme = "Cookies" ,
115120 Authority = identityUrl . ToString ( ) ,
116- PostLogoutRedirectUri = callBackUrl . ToString ( ) ,
121+ PostLogoutRedirectUri = callBackUrl . ToString ( ) ,
117122 ClientId = "mvc" ,
118123 ClientSecret = "secret" ,
119- ResponseType = "code id_token" ,
124+ ResponseType = "code id_token" ,
120125 SaveTokens = true ,
121126 GetClaimsFromUserInfoEndpoint = true ,
122127 RequireHttpsMetadata = false ,
0 commit comments