From 58f36d03eabc22461f0c295fd99ca22f7f8aa769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Mon, 13 Jul 2020 21:40:22 +0200 Subject: [PATCH] fix: add keepAliveTimeout option --- lib/options.js | 2 ++ lib/server-impl.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/options.js b/lib/options.js index f848829404..775c0ac7c8 100644 --- a/lib/options.js +++ b/lib/options.js @@ -52,6 +52,8 @@ function defaultOptions() { customContextFields: [], disableDBMigration: false, start: true, + keepAliveTimeout: 60 * 1000, + headersTimeout: 61 * 1000, }; } diff --git a/lib/server-impl.js b/lib/server-impl.js index f3965897f8..cd2539d3fe 100644 --- a/lib/server-impl.js +++ b/lib/server-impl.js @@ -66,6 +66,8 @@ async function createApp(options) { const server = app.listen(options.listen, () => logger.info('Unleash has started.', server.address()), ); + server.keepAliveTimeout = options.keepAliveTimeout; + server.headersTimeout = options.headersTimeout; server.on('listening', () => { resolve({ ...payload, server }); });