Skip to content

Commit c7c176c

Browse files
Changed HealthCheck Cache duration time (Zero == No Cache) configuration for the Basket microservice. This is better for demos and can be changed at any time.
1 parent 73be25e commit c7c176c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/Services/Basket/Basket.API/Startup.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
5858

5959
services.AddHealthChecks(checks =>
6060
{
61-
checks.AddValueTaskCheck("HTTP Endpoint", () => new ValueTask<IHealthCheckResult>(HealthCheckResult.Healthy("Ok")));
61+
checks.AddValueTaskCheck("HTTP Endpoint", () => new ValueTask<IHealthCheckResult>(HealthCheckResult.Healthy("Ok")),
62+
TimeSpan.Zero //No cache for this HealthCheck, better just for demos
63+
);
6264
});
6365

6466
services.Configure<BasketSettings>(Configuration);

src/Web/WebStatus/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void ConfigureServices(IServiceCollection services)
3939
}
4040

4141
checks.AddUrlCheckIfNotNull(Configuration["OrderingUrl"], TimeSpan.FromMinutes(minutes));
42-
checks.AddUrlCheckIfNotNull(Configuration["BasketUrl"], TimeSpan.FromMinutes(minutes));
42+
checks.AddUrlCheckIfNotNull(Configuration["BasketUrl"], TimeSpan.Zero); //No cache for this HealthCheck, better just for demos
4343
checks.AddUrlCheckIfNotNull(Configuration["CatalogUrl"], TimeSpan.FromMinutes(minutes));
4444
checks.AddUrlCheckIfNotNull(Configuration["IdentityUrl"], TimeSpan.FromMinutes(minutes));
4545
checks.AddUrlCheckIfNotNull(Configuration["LocationsUrl"], TimeSpan.FromMinutes(minutes));

0 commit comments

Comments
 (0)