set tcp hang up time to 60s instead of default 30s

This commit is contained in:
Keagan McClelland
2022-02-17 13:42:17 -07:00
parent ac94aa9f88
commit 5e807f5c91

View File

@@ -51,6 +51,7 @@ import Network.Wai.Handler.Warp ( Settings
, setHost
, setOnException
, setPort
, setTimeout
)
import Network.Wai.Handler.WarpTLS
import Network.Wai.Middleware.AcceptOverride
@@ -255,7 +256,8 @@ makeAuthWare _ app req res = next
-- | Warp settings for the given foundation value.
warpSettings :: AppPort -> RegistryCtx -> Settings
warpSettings port foundation =
setPort (fromIntegral port)
setTimeout 60
$ setPort (fromIntegral port)
$ setHost (appHost $ appSettings foundation)
$ setOnException (\_req e ->
when (defaultShouldDisplayException e) $ messageLoggerSource