@@ -75,7 +75,7 @@ module Development.IDE.Core.Shake(
75
75
VFSModified (.. ), getClientConfigAction ,
76
76
) where
77
77
78
- import Control.Concurrent (withMVar )
78
+ import Control.Concurrent (takeMVar , withMVar )
79
79
import Control.Concurrent.Async
80
80
import Control.Concurrent.STM
81
81
import Control.Concurrent.STM.Stats (atomicallyNamed )
@@ -729,16 +729,17 @@ shakeSessionInit recorder ide@IdeState{..} = do
729
729
730
730
shakeShut :: Recorder (WithPriority Log ) -> IdeState -> IO ()
731
731
shakeShut recorder IdeState {.. } = do
732
- res <- timeout 1 $ withMVar shakeSession $ \ runner -> do
733
- -- Shake gets unhappy if you try to close when there is a running
734
- -- request so we first abort that.
735
- cancelShakeSession runner
736
- void $ shakeDatabaseProfile shakeDb
737
- progressStop $ progress shakeExtras
738
- stopMonitoring
732
+ res <- timeout 1 $ takeMVar shakeSession
739
733
case res of
734
+ Just session -> do
735
+ -- Shake gets unhappy if you try to close when there is a running
736
+ -- request so we first abort that.
737
+ cancelShakeSession session
738
+ void $ shakeDatabaseProfile shakeDb
739
+ progressStop $ progress shakeExtras
740
+ stopMonitoring
741
+ case res of
740
742
Nothing -> logWith recorder Error $ LogTimeOutShuttingDownWaitForSessionVar 1
741
- Just _ -> pure ()
742
743
743
744
744
745
-- | This is a variant of withMVar where the first argument is run unmasked and if it throws
0 commit comments