Skip to content

Commit ab90c30

Browse files
committed
Fix undesired dependency on the debouncer map.
The dependency could lead to delaying the action more than intended
1 parent 06d77cc commit ab90c30

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Development.IDE.Core.Debouncer
1111
import Control.Concurrent.Async
1212
import Control.Concurrent.STM
1313
import Control.Concurrent.STM.Stats (atomicallyNamed)
14-
import Control.Exception
1514
import Control.Monad (join, void)
1615
import Data.Hashable
1716
import GHC.Conc (unsafeIOToSTM)
@@ -49,8 +48,9 @@ asyncRegisterEvent d delay k fire = join $ atomicallyNamed "debouncer - register
4948
join $ atomicallyNamed "debouncer - sleep" $ do
5049
(s,act) <- readTVar var
5150
unsafeIOToSTM $ sleep s
52-
STM.delete k d
53-
return act
51+
return $ do
52+
atomically (STM.delete k d)
53+
act
5454

5555
-- | Debouncer used in the DAML CLI compiler that emits events immediately.
5656
noopDebouncer :: Debouncer k

0 commit comments

Comments
 (0)