Browse Source

Added health options.

pull/334/head
Sebastian Stehle 7 years ago
parent
commit
af6db3d3e8
  1. 6
      src/Squidex.Infrastructure/Diagnostics/HealthCheckResult.cs
  2. 2
      src/Squidex/Pipeline/Diagnostics/HealthCheckMiddleware.cs
  3. 17
      src/Squidex/appsettings.json

6
src/Squidex.Infrastructure/Diagnostics/HealthCheckResult.cs

@ -11,15 +11,15 @@ namespace Squidex.Infrastructure.Diagnostics
{
public sealed class HealthCheckResult
{
public bool IsValid { get; }
public bool IsHealthy { get; }
public string Description { get; }
public Dictionary<string, object> Data { get; }
public HealthCheckResult(bool isValid, string description = null, Dictionary<string, object> data = null)
public HealthCheckResult(bool isHealthy, string description = null, Dictionary<string, object> data = null)
{
IsValid = isValid;
IsHealthy = isHealthy;
Data = data;
Description = description;
}

2
src/Squidex/Pipeline/Diagnostics/HealthCheckMiddleware.cs

@ -43,7 +43,7 @@ namespace Squidex.Pipeline.Diagnostics
context.Response.StatusCode = 200;
context.Response.Headers.Add("content-type", "application/json");
if (checks.Any(x => !x.Result.IsValid))
if (checks.Any(x => !x.Result.IsHealthy))
{
context.Response.StatusCode = 503;
}

17
src/Squidex/appsettings.json

@ -49,19 +49,28 @@
}
},
"healthz": {
"gc": {
/*
* The maximum number of megabyte that the process can consume until it is marked as not healthy.
*/
"threshold": 4096
}
},
"contentsController": {
/*
* Enable surrogate keys as headers.
*
* Nginx Has problems with long headers. It might make sense to disable this feature if you do not use a CDN.
*/
"enableSurrogateKeys": true,
"enableSurrogateKeys": true,
/*
/*
* Restrict the surrogate keys to results that have less than 200 items.
*/
"maxItemsForSurrogateKeys": 200
},
"maxItemsForSurrogateKeys": 200
},
"content": {
/*

Loading…
Cancel
Save