Skip to content

Commit

Permalink
Do not forceTimeOut when a threadGroup has been set
Browse files Browse the repository at this point in the history
  • Loading branch information
Raveline committed Mar 13, 2024
1 parent aa2f47a commit 314aa12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Happstack/Server/Internal/Listen.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE BangPatterns, CPP, ScopedTypeVariables #-}
module Happstack.Server.Internal.Listen(listen, listen',listenOn,listenOnIPv4) where

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

infi `finally` (Socket.close s >> forceTimeoutAll tm)
infi `finally` (Socket.close s >> when (isNothing $ threadGroup conf) (forceTimeoutAll tm))

{--
#ifndef mingw32_HOST_OS
Expand Down

0 comments on commit 314aa12

Please sign in to comment.