Skip to content

Commit 314aa12

Browse files
committed
Do not forceTimeOut when a threadGroup has been set
1 parent aa2f47a commit 314aa12

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Happstack/Server/Internal/Listen.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables #-}
22
module Happstack.Server.Internal.Listen(listen, listen',listenOn,listenOnIPv4) where
33

4+
import Data.Maybe (isNothing)
45
import Happstack.Server.Internal.Types (Conf(..), Request, Response)
56
import Happstack.Server.Internal.Handler (request)
67
import Happstack.Server.Internal.Socket (acceptLite)
@@ -118,7 +119,7 @@ listen' s conf hand = do
118119
infi :: IO ()
119120
infi = loop `catchSome` pe >> infi
120121

121-
infi `finally` (Socket.close s >> forceTimeoutAll tm)
122+
infi `finally` (Socket.close s >> when (isNothing $ threadGroup conf) (forceTimeoutAll tm))
122123

123124
{--
124125
#ifndef mingw32_HOST_OS

0 commit comments

Comments
 (0)