Skip to content

Commit 2eb9448

Browse files
authored
chore: set server 60s timeout (#406)
1 parent 8210836 commit 2eb9448

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/server/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ import { withWebSocket } from "./middleware/websocket";
1818
import { withRoutes } from "./routes";
1919
import { writeOpenApiToFile } from "./utils/openapi";
2020

21+
// The server timeout in milliseconds.
22+
// Source: https://fastify.dev/docs/latest/Reference/Server/#connectiontimeout
23+
const SERVER_CONNECTION_TIMEOUT = 60_000;
24+
2125
const __dirname = new URL(".", import.meta.url).pathname;
2226

2327
interface HttpsObject {
@@ -47,6 +51,7 @@ export const initServer = async () => {
4751

4852
// Start the server with middleware.
4953
const server: FastifyInstance = fastify({
54+
connectionTimeout: SERVER_CONNECTION_TIMEOUT,
5055
disableRequestLogging: true,
5156
...(env.ENABLE_HTTPS ? httpsObject : {}),
5257
}).withTypeProvider<TypeBoxTypeProvider>();

0 commit comments

Comments
 (0)