From a73e271d604616e1e0cdb5d2720e851d7b9acb73 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 12 Aug 2012 12:36:08 -0400 Subject: run resumed transfers immediately, do not wait for free transfer slot The resumed transfer still uses a slot, so will delay other, queued transfers from starting. --- Assistant/Threads/Transferrer.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Assistant/Threads/Transferrer.hs') diff --git a/Assistant/Threads/Transferrer.hs b/Assistant/Threads/Transferrer.hs index c349acf44..8118a3f3c 100644 --- a/Assistant/Threads/Transferrer.hs +++ b/Assistant/Threads/Transferrer.hs @@ -38,7 +38,7 @@ transfererThread st dstatus transferqueue slots = go ( do debug thisThread [ "Transferring:" , show t ] notifyTransfer dstatus - transferThread dstatus slots t info + transferThread dstatus slots t info inTransferSlot , do debug thisThread [ "Skipping unnecessary transfer:" , show t ] -- getNextTransfer added t to the @@ -78,12 +78,12 @@ shouldTransfer t info - the transfer info; the thread will also be killed when a transfer is - stopped, to avoid it displaying any alert about the transfer having - failed. -} -transferThread :: DaemonStatusHandle -> TransferSlots -> Transfer -> TransferInfo -> IO () -transferThread dstatus slots t info = case (transferRemote info, associatedFile info) of +transferThread :: DaemonStatusHandle -> TransferSlots -> Transfer -> TransferInfo -> TransferSlotRunner -> IO () +transferThread dstatus slots t info runner = case (transferRemote info, associatedFile info) of (Nothing, _) -> noop (_, Nothing) -> noop (Just remote, Just file) -> do - tid <- inTransferSlot slots $ + tid <- runner slots $ transferprocess remote file updateTransferInfo dstatus t $ info { transferTid = Just tid } where -- cgit v1.2.3