Explorar el Código

fix(api-gateway): add possibility to configure keep-alive timeout (#920)

Karol Sójko hace 1 año
padre
commit
16f92bdc99
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      packages/api-gateway/bin/server.ts

+ 4 - 2
packages/api-gateway/bin/server.ts

@@ -102,9 +102,11 @@ void container.load().then((container) => {
     })
   })
 
-  const serverInstance = server.build()
+  const serverInstance = server.build().listen(env.get('PORT'))
 
-  serverInstance.listen(env.get('PORT'))
+  const keepAliveTimeout = env.get('KEEP_ALIVE_TIMEOUT', true) ? +env.get('KEEP_ALIVE_TIMEOUT', true) : 5000
+
+  serverInstance.keepAliveTimeout = keepAliveTimeout
 
   logger.info(`Server started on port ${process.env.PORT}`)
 })