食人鱼CMS设置健康检查



我正在尝试设置HealthCheck's与食人鱼CMS。这些在本地工作得很好,但是一旦我部署了端点,就会出现500个内部错误。是否有一些我错过了注册HealthCheck的与食人鱼CMS。我已经尝试过将这些移动到应用程序中。和服务。AddPiranha(options =>),但仍然无法访问HealthCheck端点。

这两个都在食人鱼注册的上方。

services.AddHealthChecks()
.AddCheck<DealerUserSyncHealthCheck>("DealerSync Health Check", null, new[] { "DealerSync" })
.AddCheck<VendorSyncHealthCheck>("VendorSync Health Check", null, new[] { "VendorSync" })
.AddCheck<ContactUserSyncHealthCheck>("ContactUserSync Health Check", null, new[] { "ContactUserSync" })
.AddCheck<DbHealthCheck>("Db Health Check", null, new[] { "Db" })
.AddCheck<SendGridHealthCheck>("SendGrid Health Check", null, new[] { "SendGrid" })
.AddCheck<RedisHealthCheck>("Redis Health Check", null, new[] { "Redis" });
OBESettings settings = new OBESettings();
Configuration.Bind(settings);
// Setup Health Check Endpoints
app.UseEndpoints(endpoints =>
{
endpoints.MapHealthChecks("/DealerSyncCheck", new HealthCheckOptions
{
Predicate = healthCheck => healthCheck.Tags.Contains("DealerSync")
});//.RequireHost(settings.HealthCheckWhitelist);
endpoints.MapHealthChecks("/VendorSyncCheck", new HealthCheckOptions
{
Predicate = healthCheck => healthCheck.Tags.Contains("VendorSync")
});//.RequireHost(settings.HealthCheckWhitelist);
endpoints.MapHealthChecks("/ContactUserSyncCheck", new HealthCheckOptions
{
Predicate = healthCheck => healthCheck.Tags.Contains("ContactUserSync")
});//.RequireHost(settings.HealthCheckWhitelist);
endpoints.MapHealthChecks("/DbCheck", new HealthCheckOptions
{
Predicate = healthCheck => healthCheck.Tags.Contains("Db")
});//.RequireHost(settings.HealthCheckWhitelist);
endpoints.MapHealthChecks("/SendGridCheck", new HealthCheckOptions
{
Predicate = healthCheck => healthCheck.Tags.Contains("SendGrid")
});//.RequireHost(settings.HealthCheckWhitelist);
endpoints.MapHealthChecks("/RedisCheck", new HealthCheckOptions
{
Predicate = healthCheck => healthCheck.Tags.Contains("Redis")
});//.RequireHost(settings.HealthCheckWhitelist);
});

我已经将healthcheck注册移到了服务之上。添加食人鱼和app.UsePiranha注册。我不得不添加回调用services.AddControllers();for ConfigureServices和app.UseRouting();配置。现在一切都可以正常运行了。

最新更新