@@ -498,35 +498,18 @@ withMVar' var unmasked masked = mask $ \restore -> do
498
498
pure c
499
499
500
500
501
- -- | Actions with an ID for tracing purposes
502
- data DelayedActionExtra
503
- = DelayedActionExtra
504
- { _actionInternalId :: Unique
505
- , _actionInternal :: Action ()
506
- }
507
-
508
- type DelayedAction a = DelayedActionX (Action a )
509
- type DelayedActionInternal = DelayedActionX DelayedActionExtra
510
-
511
- {-# COMPLETE DelayedActionInternal#-}
512
- pattern DelayedActionInternal :: String -> Logger. Priority -> Action () -> Unique -> DelayedActionX DelayedActionExtra
513
- pattern DelayedActionInternal { _actionInternalName, _actionInternalPriority, getAction , _actionId}
514
- = DelayedActionX _actionInternalName _actionInternalPriority (DelayedActionExtra _actionId getAction)
515
-
516
- {-# COMPLETE DelayedAction#-}
517
- pattern DelayedAction :: String -> Logger. Priority -> Action a -> DelayedAction a
518
- pattern DelayedAction a b c = DelayedActionX a b c
519
-
520
501
mkDelayedAction :: String -> Logger. Priority -> Action a -> DelayedAction a
521
502
mkDelayedAction = DelayedAction
522
503
523
- data DelayedActionX a = DelayedActionX
504
+ data DelayedAction a = DelayedAction
524
505
{ actionName :: String -- ^ Name we show to the user
525
506
, actionPriority :: Logger. Priority -- ^ Priority with which to log the action
526
- , _actionExtra :: a -- ^ The payload
507
+ , getAction :: Action a -- ^ The payload
527
508
}
528
509
529
- instance Show (DelayedActionX a ) where
510
+ type DelayedActionInternal = DelayedAction ()
511
+
512
+ instance Show (DelayedAction a ) where
530
513
show d = " DelayedAction: " ++ actionName d
531
514
532
515
-- | These actions are run asynchronously after the current action is
@@ -640,7 +623,6 @@ newSession ShakeExtras{..} shakeDb systemActs userActs = do
640
623
instantiateDelayedAction :: DelayedAction a -> IO (Barrier (Either SomeException a ), DelayedActionInternal )
641
624
instantiateDelayedAction (DelayedAction s p a) = do
642
625
b <- newBarrier
643
- i <- newUnique
644
626
let a' = do
645
627
-- work gets reenqueued when the Shake session is restarted
646
628
-- it can happen that a work item finished just as it was reenqueud
@@ -649,7 +631,7 @@ instantiateDelayedAction (DelayedAction s p a) = do
649
631
unless alreadyDone $ do
650
632
x <- actionCatch @ SomeException (Right <$> a) (pure . Left )
651
633
liftIO $ signalBarrier b x
652
- let d = DelayedActionInternal s p a' i
634
+ let d = DelayedAction s p a'
653
635
return (b, d)
654
636
655
637
logDelayedAction :: Logger -> DelayedActionInternal -> Action ()
0 commit comments