You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/migration.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -205,8 +205,6 @@ A new `skipProcessEnv` option has also been introduced. This option allows you t
205
205
206
206
If you are using the `TerminusModule` and have built your own custom health indicator, a new API has been introduced in version 11. The new `HealthIndicatorService` is designed to enhance the readability and testability of custom health indicators.
207
207
208
-
**Previous Approach**
209
-
210
208
Before version 11, a health indicator might have looked like this:
211
209
212
210
```typescript
@@ -216,21 +214,14 @@ export class DogHealthIndicator extends HealthIndicator {
In version 11, it is recommended to use the new `HealthIndicatorService` API, which simplifies the implementation. Here's how the same health indicator can be implemented:
248
+
Starting with version 11, it is recommended to use the new `HealthIndicatorService` API, which streamlines the implementation process. Here's how the same health indicator can now be implemented:
251
249
252
250
```typescript
253
251
@Injectable()
@@ -258,8 +256,6 @@ export class DogHealthIndicator {
@@ -278,15 +274,19 @@ export class DogHealthIndicator {
278
274
returnindicator.down('Unable to retrieve dogs');
279
275
}
280
276
}
277
+
278
+
private getBadboys() {
279
+
// ...
280
+
}
281
281
}
282
282
```
283
283
284
-
**Key changes**
284
+
Key changes:
285
285
286
-
- The `HealthIndicatorService` replaces the older`HealthIndicator` and `HealthCheckError` classes, providing a cleaner API for health checks.
287
-
- The `check` method allows easy state tracking (`up` or `down`) while supporting additional metadata to be included in health check responses.
286
+
- The `HealthIndicatorService` replaces the legacy`HealthIndicator` and `HealthCheckError` classes, providing a cleaner API for health checks.
287
+
- The `check` method allows for easy state tracking (`up` or `down`) while supporting the inclusion of additional metadata in health check responses.
288
288
289
-
> info **Info** Please note that the `HealthIndicator` and `HealthCheckError` classes have been marked as deprecated and are scheduled for removal in the next major release.
289
+
> info **Info** Please note that the `HealthIndicator` and `HealthCheckError` classes have been marked as deprecated and are scheduled for removal in the next major release.
0 commit comments