summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Committer.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-29 19:30:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-29 19:30:23 -0400
commit4c12d38e33923c929a1a264d5b511fb5b8afdf33 (patch)
tree1b40e5f4cb72ffe6f6c43bb55eadbdef9d615922 /Assistant/Threads/Committer.hs
parentc65199b29e85cb145d460b9e48fe2fc4a10aeb09 (diff)
split Changes and lifted
Diffstat (limited to 'Assistant/Threads/Committer.hs')
-rw-r--r--Assistant/Threads/Committer.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index b3a737872..3c283e38b 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -11,6 +11,7 @@ module Assistant.Threads.Committer where
import Assistant.Common
import Assistant.Changes
+import Assistant.Types.Changes
import Assistant.Commits
import Assistant.Alert
import Assistant.Threads.Watcher
@@ -45,7 +46,7 @@ commitThread = NamedThread "Committer" $ do
-- We already waited one second as a simple rate limiter.
-- Next, wait until at least one change is available for
-- processing.
- changes <- getChanges <<~ changeChan
+ changes <- getChanges
-- Now see if now's a good time to commit.
time <- liftIO getCurrentTime
if shouldCommit time changes
@@ -67,7 +68,7 @@ commitThread = NamedThread "Committer" $ do
refill [] = noop
refill cs = do
debug ["delaying commit of", show (length cs), "changes"]
- flip refillChanges cs <<~ changeChan
+ refillChanges cs
commitStaged :: Annex Bool
commitStaged = do
@@ -148,15 +149,14 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do
(postponed, toadd) <- partitionEithers <$> safeToAdd delayadd pending' inprocess
unless (null postponed) $
- flip refillChanges postponed <<~ changeChan
+ refillChanges postponed
returnWhen (null toadd) $ do
added <- catMaybes <$> forM toadd add
if DirWatcher.eventsCoalesce || null added
then return $ added ++ otherchanges
else do
- r <- handleAdds delayadd
- =<< getChanges <<~ changeChan
+ r <- handleAdds delayadd =<< getChanges
return $ r ++ added ++ otherchanges
where
(incomplete, otherchanges) = partition (\c -> isPendingAddChange c || isInProcessAddChange c) cs