Commit 4af25fc
authored
fix(server): set keep-alive and header timeouts (#4925)
<!-- Describe the problem and your solution -->
<!-- Issue ticket number and link (if applicable) -->
<!-- Testing instructions (skip if just adding/editing providers) -->
<!-- Summary by @propel-code-bot -->
---
**Set HTTP keep-alive & header timeouts via env var**
Adds explicit timeout management to the HTTP server to reduce the risk
of long-lived idle sockets and header stalls. The change introduces a
new configurable environment variable so operators can tune the timeout
without code changes.
<details>
<summary><strong>Key Changes</strong></summary>
• Set `server.keepAliveTimeout` from
`envs.NANGO_SERVER_KEEP_ALIVE_TIMEOUT` in
`packages/server/lib/server.ts`
• Set `server.headersTimeout` to `envs.NANGO_SERVER_KEEP_ALIVE_TIMEOUT +
1000` to satisfy Node.js requirement that it exceeds keep-alive timeout
• Declare new env schema key `NANGO_SERVER_KEEP_ALIVE_TIMEOUT` with
default `61_000` (61 s) in `packages/utils/lib/environment/parse.ts`
</details>
<details>
<summary><strong>Affected Areas</strong></summary>
• `packages/server/lib/server.ts`
• `packages/utils/lib/environment/parse.ts`
</details>
---
*This summary was automatically generated by @propel-code-bot*1 parent a9f92b7 commit 4af25fc
2 files changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
0 commit comments