aboutsummaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-01-13 14:55:01 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-01-13 14:55:01 -0400
commit3b72782586f5f6872d00891f6b46f5a8cb654e7a (patch)
treeeedcc18e399d06aa77c6637264d7bad3836fe94b /Assistant
parentc747c8e423afe272dcf045abf3f1e8c1f6985e5c (diff)
immediate queue flushing when annex.queuesize=1
Previously, it only flushed when the queue got larger than 1. Also, make the queue auto-flush when items are added, rather than needing to be flushed as a separate step. This simplifies the code and make it more efficient too, as it avoids needing to read the queue out of the state to check if it should be flushed.
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/Watcher.hs7
1 files changed, 1 insertions, 6 deletions
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs
index d10f929d0..1fc20a906 100644
--- a/Assistant/Threads/Watcher.hs
+++ b/Assistant/Threads/Watcher.hs
@@ -195,11 +195,7 @@ runHandler handler file filestatus = void $ do
case r of
Left e -> liftIO $ warningIO $ show e
Right Nothing -> noop
- Right (Just change) -> do
- -- Just in case the commit thread is not
- -- flushing the queue fast enough.
- liftAnnex Annex.Queue.flushWhenFull
- recordChange change
+ Right (Just change) -> recordChange change
where
normalize f
| "./" `isPrefixOf` file = drop 2 f
@@ -391,7 +387,6 @@ onDelDir dir _ = do
recordChanges $ map (\f -> Change now f RmChange) fs
void $ liftIO clean
- liftAnnex Annex.Queue.flushWhenFull
noChange
{- Called when there's an error with inotify or kqueue. -}