Conversation
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
|
Preview deployment ✅ Deployment complete!
|
ArmandPhilippot
left a comment
There was a problem hiding this comment.
Thanks @WhatCats, and welcome! I’ve left a few suggestions to make the section consistent with how we document APIs and how we write.
|
|
||
| <p> | ||
| **Type:** `{ timeout?: number; exit?: boolean }` <br /> | ||
| **Default:** `{ timeout: 10000, exit: false }` (10 second timeout, process exits naturally)<br /> |
There was a problem hiding this comment.
Unless the value can be hard to understand (e.g. bodySizeLimit), we usually don't had parentheses: the description is here to explain the values.
| **Default:** `{ timeout: 10000, exit: false }` (10 second timeout, process exits naturally)<br /> | |
| **Default:** `{ timeout: 10000, exit: false }`<br /> |
| <Since pkg="@astrojs/node" v="11.2.0" /> | ||
| </p> | ||
|
|
||
| Controls graceful shutdown of the [`standalone`](#mode) server when it receives a `SIGTERM` or `SIGINT` signal (for example, when your host stops or restarts the process). The server stops accepting new connections but waits for in-flight requests to finish before closing. |
There was a problem hiding this comment.
We use e.g. for the example in parentheses and we prefer simpler vocabulary. I feel "in-flight" might not be explicit enough for non-native speakers or less technical people. I'm not sure what would be the most accurate ("active"/"current"/"ongoing"), feel free to correct my suggestion.
| Controls graceful shutdown of the [`standalone`](#mode) server when it receives a `SIGTERM` or `SIGINT` signal (for example, when your host stops or restarts the process). The server stops accepting new connections but waits for in-flight requests to finish before closing. | |
| Controls graceful shutdown behavior of the [`standalone`](#mode) server when it receives a `SIGTERM` or `SIGINT` signal (e.g. when a host stops or restarts the process). The server stops accepting new connections but waits for active requests to finish before closing. |
| Configure the following: | ||
|
|
||
| * **`timeout`** controls how long, in milliseconds, to wait for in-flight requests to finish before force-closing any remaining connections. Set to `0` to force-close immediately, or `Infinity` to wait indefinitely for in-flight requests to finish. | ||
| * **`exit`** controls whether to call `process.exit()` once shutdown completes. By default, the adapter lets the process exit naturally once the event loop is empty, so any other `SIGTERM`/`SIGINT` listeners your app has registered (for example, to close a database connection) get a chance to finish first. Enable this only if you want a guaranteed exit even when something else in the process (a timer, an open connection) would otherwise keep it running. |
There was a problem hiding this comment.
We use subheadings to document nested properties and we introduce code snippets with a sentence:
| Configure the following: | |
| * **`timeout`** controls how long, in milliseconds, to wait for in-flight requests to finish before force-closing any remaining connections. Set to `0` to force-close immediately, or `Infinity` to wait indefinitely for in-flight requests to finish. | |
| * **`exit`** controls whether to call `process.exit()` once shutdown completes. By default, the adapter lets the process exit naturally once the event loop is empty, so any other `SIGTERM`/`SIGINT` listeners your app has registered (for example, to close a database connection) get a chance to finish first. Enable this only if you want a guaranteed exit even when something else in the process (a timer, an open connection) would otherwise keep it running. | |
| The following example configures a 30-second shutdown timeout and forces the process to exit once the shutdown is complete: |
| }), | ||
| }); | ||
| ``` | ||
|
|
There was a problem hiding this comment.
I moved your the nested properties description to their own subheadings. And I tried to tighten a bit the wording to be more direct. Feel free to tell if any important information is missing.
| #### `shutdown.timeout` | |
| <p> | |
| **Type:** `number`<br /> | |
| **Default:** `10000` | |
| </p> | |
| The duration in milliseconds to wait for active requests to finish before force-closing remaining connections. Set to `0` to force-close immediately, or `Infinity` to wait indefinitely. | |
| #### `shutdown.exit` | |
| <p> | |
| **Type:** `boolean`<br /> | |
| **Default:** `false` | |
| </p> | |
| Controls whether to call `process.exit()` once shutdown completes. By default, the process exits naturally when the event loop is empty, allowing other signal listeners (e.g. database disconnect handlers) to finish first. Set to `true` to force the process to exit even if open timers or connections remain. | |
Description
Documents the new
shutdownconfig option for the Node adapter, which controls graceful shutdown behavior (timeout andexit) when the standalone server receivesSIGTERM/SIGINT.References
tbd