Skip to content

Commit a3c86b0

Browse files
committed
do not use progressStop if shake could not be cancel yet
1 parent 79a8a5f commit a3c86b0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module Development.IDE.Core.Shake(
7575
VFSModified(..), getClientConfigAction,
7676
) where
7777

78-
import Control.Concurrent (withMVar)
78+
import Control.Concurrent (tryReadMVar, withMVar)
7979
import Control.Concurrent.Async
8080
import Control.Concurrent.STM
8181
import Control.Concurrent.STM.Stats (atomicallyNamed)
@@ -734,11 +734,14 @@ shakeShut recorder IdeState{..} = do
734734
-- request so we first abort that.
735735
cancelShakeSession runner
736736
void $ shakeDatabaseProfile shakeDb
737+
-- might hang if there are still running
738+
progressStop $ progress shakeExtras
739+
stopMonitoring
737740
case res of
738-
Nothing -> logWith recorder Error $ LogTimeOutShuttingDownWaitForSessionVar 1
741+
Nothing -> do
742+
logWith recorder Error $ LogTimeOutShuttingDownWaitForSessionVar 1
743+
stopMonitoring
739744
Just _ -> pure ()
740-
progressStop $ progress shakeExtras
741-
stopMonitoring
742745

743746
-- | This is a variant of withMVar where the first argument is run unmasked and if it throws
744747
-- an exception, the previous value is restored while the second argument is executed masked.

0 commit comments

Comments
 (0)