Commit 4a5471c
committed
The most significant changes involve the addition of new namespaces to the
Changes:
1. The `Microsoft.Extensions.Diagnostics.HealthChecks` and `XperienceCommunity.AspNetCore.HealthChecks.Publishers` namespaces have been added to the `DependencyInjection.cs` file. This change allows the use of health check diagnostics and publishers in the code.
2. A new parameter `useEventLogPublisher` of type `bool` has been added to the `AddKenticoHealthChecks` method in the `XperienceCommunity.AspNetCore.HealthChecks` namespace. This parameter is used to determine whether to use the `KenticoEventLogHealthCheckPublisher`.
3. A conditional statement has been added inside the `AddKenticoHealthChecks` method to check if `useEventLogPublisher` is true. If it is, the `HealthCheckPublisherOptions` are configured with a delay of 2 seconds and a predicate that checks if the health check tags contain 'Kentico'. This change allows for the configuration of health check options based on the `useEventLogPublisher` parameter.
4. A singleton of type `IHealthCheckPublisher` is registered with the `KenticoEventLogHealthCheckPublisher` implementation if `useEventLogPublisher` is true. This change ensures that the `KenticoEventLogHealthCheckPublisher` is used when `useEventLogPublisher` is true.
5. The `AddKenticoHealthChecks` method now returns an `IHealthChecksBuilder` instance with the same health checks as before, but also includes the configuration for the `KenticoEventLogHealthCheckPublisher` if `useEventLogPublisher` is true. This change ensures that the health checks include the `KenticoEventLogHealthCheckPublisher` configuration when `useEventLogPublisher` is true.DependencyInjection.cs file and the introduction of a new parameter to the AddKenticoHealthChecks method. This new parameter, useEventLogPublisher, is used to conditionally configure the HealthCheckPublisherOptions and register a singleton of type IHealthCheckPublisher with the KenticoEventLogHealthCheckPublisher implementation. The AddKenticoHealthChecks method now also includes the configuration for the KenticoEventLogHealthCheckPublisher if useEventLogPublisher is true.1 parent 7bb7ecb commit 4a5471c
File tree
1 file changed
+17
-3
lines changed- src/XperienceCommunity.AspNetCore.HealthChecks
1 file changed
+17
-3
lines changedLines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | | - | |
20 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
21 | 35 | | |
22 | 36 | | |
23 | 37 | | |
| |||
28 | 42 | | |
29 | 43 | | |
30 | 44 | | |
31 | | - | |
| 45 | + | |
32 | 46 | | |
33 | 47 | | |
34 | 48 | | |
0 commit comments