From c5707c84d372fc668b957c5d0b224bcf524e04f1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 10 Jun 2012 13:56:04 -0400 Subject: queue size fix Increase queue size for update-index actions, because otherwise they'll never be flushed. --- Annex/Queue.hs | 7 ++++++- Git/Queue.hs | 8 ++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Annex/Queue.hs b/Annex/Queue.hs index a7d4e153b..c019aed6c 100644 --- a/Annex/Queue.hs +++ b/Annex/Queue.hs @@ -9,7 +9,8 @@ module Annex.Queue ( addCommand, addUpdateIndex, flush, - flushWhenFull + flushWhenFull, + size ) where import Common.Annex @@ -45,6 +46,10 @@ flush = do q' <- inRepo $ Git.Queue.flush q store q' +{- Gets the size of the queue. -} +size :: Annex Int +size = Git.Queue.size <$> get + get :: Annex Git.Queue.Queue get = maybe new return =<< getState repoqueue diff --git a/Git/Queue.hs b/Git/Queue.hs index 78b52a2bc..acf6cd091 100644 --- a/Git/Queue.hs +++ b/Git/Queue.hs @@ -98,14 +98,10 @@ addCommand subcommand params files q repo = different (CommandAction { getSubcommand = s }) = s /= subcommand different _ = True -{- Adds an update-index streamer to the queue. - - - - Note that this does not increase the queue size, because data is - - streamed into update-index, so command-line length limits are not - - involved. -} +{- Adds an update-index streamer to the queue. -} addUpdateIndex :: Git.UpdateIndex.Streamer -> Queue -> Repo -> IO Queue addUpdateIndex streamer q repo = - updateQueue action different 0 q repo + updateQueue action different 1 q repo where key = actionKey action -- streamer is added to the end of the list, since -- cgit v1.2.3