Skip to content

Commit 0ef2a9f

Browse files
committed
add shutdown timeout in stop
Signed-off-by: LeTamanoir <[email protected]>
1 parent af4d68f commit 0ef2a9f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/adapter/types.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,18 @@ export interface ElysiaAdapter {
2626
*
2727
* @example
2828
* ```typescript
29-
* app.stop(true) // Abruptly any requests inflight
29+
* app.stop({ closeActiveConnections: true }) // Abruptly stop any requests inflight
30+
* ```
31+
*
32+
* @example
33+
* ```typescript
34+
* app.stop({ shutdownTimeout: 1000 }) // Wait for 1 second to stop the server
3035
* ```
3136
*/
32-
stop?(app: AnyElysia, closeActiveConnections?: boolean): Promise<void>
37+
stop?(
38+
app: AnyElysia,
39+
params: { closeActiveConnections?: boolean; shutdownTimeout?: number }
40+
): Promise<void>
3341
isWebStandard?: boolean
3442
handler: {
3543
/**

0 commit comments

Comments
 (0)