From 3b72782586f5f6872d00891f6b46f5a8cb654e7a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 13 Jan 2016 14:55:01 -0400 Subject: 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. --- CmdLine/Action.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'CmdLine/Action.hs') diff --git a/CmdLine/Action.hs b/CmdLine/Action.hs index 2579196c9..03acb04d7 100644 --- a/CmdLine/Action.hs +++ b/CmdLine/Action.hs @@ -119,11 +119,8 @@ findFreeSlot = go [] {- Like commandAction, but without the concurrency. -} includeCommandAction :: CommandStart -> CommandCleanup -includeCommandAction a = account =<< tryIO go +includeCommandAction a = account =<< tryIO (callCommandAction a) where - go = do - Annex.Queue.flushWhenFull - callCommandAction a account (Right True) = return True account (Right False) = incerr account (Left err) = do -- cgit v1.2.3