fix flush order reversion
commit c2e46f4707
caused
the queue to possibly be flushed in the wrong order when
it contained a mix of different actions.
This commit is contained in:
parent
8b3238cf42
commit
681d8611be
1 changed files with 9 additions and 4 deletions
13
Git/Queue.hs
13
Git/Queue.hs
|
@ -169,11 +169,16 @@ updateQueue :: MonadIO m => Action m -> (Action m -> Bool) -> Int -> Queue m ->
|
||||||
updateQueue !action different sizeincrease q repo = do
|
updateQueue !action different sizeincrease q repo = do
|
||||||
now <- liftIO getPOSIXTime
|
now <- liftIO getPOSIXTime
|
||||||
if now - (_lastchanged q) > _timelimit q
|
if now - (_lastchanged q) > _timelimit q
|
||||||
then flush (mk q) repo
|
then if isdifferent
|
||||||
else if null (filter different (M.elems (items q)))
|
then do
|
||||||
then return $ mk (q { _lastchanged = now })
|
q' <- flush q repo
|
||||||
else mk <$> flush q repo
|
flush (mk q') repo
|
||||||
|
else flush (mk q) repo
|
||||||
|
else if isdifferent
|
||||||
|
then mk <$> flush q repo
|
||||||
|
else return $ mk (q { _lastchanged = now })
|
||||||
where
|
where
|
||||||
|
isdifferent = not (null (filter different (M.elems (items q))))
|
||||||
mk q' = newq
|
mk q' = newq
|
||||||
where
|
where
|
||||||
!newq = q'
|
!newq = q'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue