Skip to content

Commit d7a3e87

Browse files
ScreamZjohnbiundo
andauthored
Apply suggestions from code review
Co-authored-by: John Biundo <[email protected]>
1 parent bdd533a commit d7a3e87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/fundamentals/lifecycle-events.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ In the following table, `onModuleDestroy`, `beforeApplicationShutdown` and `onAp
2424
| `beforeApplicationShutdown()`\* | Called after all `onModuleDestroy()` handlers have completed (Promises resolved or rejected);<br />once complete (Promises resolved or rejected), all existing connections will be closed (`app.close()` called). |
2525
| `onApplicationShutdown()`\* | Called after connections close (`app.close()` resolves. |
2626

27-
\* For those events, if you're not calling `app.close()` explicitly, you must opt-in to make them work with system's signals: see `Shutdown application` section below.
27+
\* For these events, if you're not calling `app.close()` explicitly, you must opt-in to make them work with system signals such as `SIGTERM`. See [Application shutdown](#application-shutdown) below.
2828

2929
#### Usage
3030

@@ -70,7 +70,7 @@ async onModuleInit() {
7070

7171
The `onModuleDestroy()`, `beforeApplicationShutdown()` and `onApplicationShutdown()` hooks are called in the terminating phase (in response to an explicit call to `app.close()` or upon receipt of system signals such as SIGTERM if opted-in). This feature is often used with [Kubernetes](https://kubernetes.io/) to manage containers' lifecycles, by [Heroku](https://www.heroku.com/) for dynos or similar services.
7272

73-
Disabled by default for performances optimizations, to use these hooks **you must enable them** by calling `enableShutdownHooks()`, which listens to shutdown signals:
73+
Shutdown hook listeners consume system resources, so they are disabled by default. To use shutdown hooks, you **must enable listeners** by calling `enableShutdownHooks()`:
7474

7575
```typescript
7676
import { NestFactory } from '@nestjs/core';

0 commit comments

Comments
 (0)