Skip to content

Commit

Permalink
docs(terminus): add section for graceful shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunnerLivio committed Nov 26, 2023
1 parent 6a373ad commit 31984ea
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions content/recipes/terminus.md
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,24 @@ You can change the log style using the `errorLogStyle` configuration option as i
export class HealthModule {}
```

#### Graceful shutdown timeout

If your application requires postponing its shutdown process, Terminus can be handle it for you.
This setting can prove particularly beneficial when working with an orchestrator such as Kubernetes.
By setting a delay slightly longer than the readiness check interval, you can achieve zero downtime when shutting down containers.

```typescript
@@filename(health.module)
@Module({
imports: [
TerminusModule.forRoot({
gracefulShutdownTimeoutMs: 1000,
}),
]
})
export class HealthModule {}
```

#### More examples

More working examples are available [here](https://github.com/nestjs/terminus/tree/master/sample).

0 comments on commit 31984ea

Please sign in to comment.