avoid repeatedly searching path to make batch command when running transferkeys

This commit is contained in:
Joey Hess 2013-12-01 15:37:51 -04:00
parent 0d91432442
commit 0fd6078865
4 changed files with 45 additions and 33 deletions

View file

@ -12,12 +12,14 @@ import Assistant.TransferQueue
import Assistant.TransferSlots
import Logs.Transfer
import Config.Files
import Utility.Batch
{- Dispatches transfers from the queue. -}
transfererThread :: NamedThread
transfererThread = namedThread "Transferrer" $ do
program <- liftIO readProgramFile
forever $ inTransferSlot program $
batchmaker <- liftIO getBatchCommandMaker
forever $ inTransferSlot program batchmaker $
maybe (return Nothing) (uncurry genTransfer)
=<< getNextTransfer notrunning
where