summaryrefslogtreecommitdiff
path: root/Annex/Queue.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2019-11-12 10:44:51 -0400
committerJoey Hess <joeyh@joeyh.name>2019-11-12 10:45:52 -0400
commit99536e3a0bae7f4dcd7c7379036090266c396169 (patch)
tree4ba655baa289f4bef8f0821865240a42bb615183 /Annex/Queue.hs
parent3edd427b84e4244c9158c4cf6a1de4cd3c2d9b96 (diff)
remove one more warningIO
Had to generalize Git.Queue so it can run an Annex action, yipes. Only remaining warningIO are in the legacy chunk code.
Diffstat (limited to 'Annex/Queue.hs')
-rw-r--r--Annex/Queue.hs26
1 files changed, 13 insertions, 13 deletions
diff --git a/Annex/Queue.hs b/Annex/Queue.hs
index 0e98897800..5bbe04dbc5 100644
--- a/Annex/Queue.hs
+++ b/Annex/Queue.hs
@@ -28,24 +28,24 @@ import qualified Git.UpdateIndex
addCommand :: String -> [CommandParam] -> [FilePath] -> Annex ()
addCommand command params files = do
q <- get
- store <=< flushWhenFull <=< inRepo $
- Git.Queue.addCommand command params files q
+ store =<< flushWhenFull =<<
+ (Git.Queue.addCommand command params files q =<< gitRepo)
-addInternalAction :: Git.Queue.InternalActionRunner -> [(FilePath, IO Bool)] -> Annex ()
+addInternalAction :: Git.Queue.InternalActionRunner Annex -> [(FilePath, IO Bool)] -> Annex ()
addInternalAction runner files = do
q <- get
- store <=< flushWhenFull <=< inRepo $
- Git.Queue.addInternalAction runner files q
+ store =<< flushWhenFull =<<
+ (Git.Queue.addInternalAction runner files q =<< gitRepo)
{- Adds an update-index stream to the queue. -}
addUpdateIndex :: Git.UpdateIndex.Streamer -> Annex ()
addUpdateIndex streamer = do
q <- get
- store <=< flushWhenFull <=< inRepo $
- Git.Queue.addUpdateIndex streamer q
+ store =<< flushWhenFull =<<
+ (Git.Queue.addUpdateIndex streamer q =<< gitRepo)
{- Runs the queue if it is full. -}
-flushWhenFull :: Git.Queue.Queue -> Annex Git.Queue.Queue
+flushWhenFull :: Git.Queue.Queue Annex -> Annex (Git.Queue.Queue Annex)
flushWhenFull q
| Git.Queue.full q = flush' q
| otherwise = return q
@@ -64,25 +64,25 @@ flush = do
- But, flushing two queues at the same time could lead to failures due to
- git locking files. So, only one queue is allowed to flush at a time.
-}
-flush' :: Git.Queue.Queue -> Annex Git.Queue.Queue
+flush' :: Git.Queue.Queue Annex -> Annex (Git.Queue.Queue Annex)
flush' q = withExclusiveLock gitAnnexGitQueueLock $ do
showStoringStateAction
- inRepo $ Git.Queue.flush q
+ Git.Queue.flush q =<< gitRepo
{- Gets the size of the queue. -}
size :: Annex Int
size = Git.Queue.size <$> get
-get :: Annex Git.Queue.Queue
+get :: Annex (Git.Queue.Queue Annex)
get = maybe new return =<< getState repoqueue
-new :: Annex Git.Queue.Queue
+new :: Annex (Git.Queue.Queue Annex)
new = do
q <- Git.Queue.new . annexQueueSize <$> getGitConfig
store q
return q
-store :: Git.Queue.Queue -> Annex ()
+store :: Git.Queue.Queue Annex -> Annex ()
store q = changeState $ \s -> s { repoqueue = Just q }
mergeFrom :: AnnexState -> Annex ()