summaryrefslogtreecommitdiff
path: root/Annex/Transfer.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-12 18:05:45 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-12 18:13:37 -0400
commit6b074fb7e741020b81d696bd66e62f75fd472966 (patch)
tree284ac39d6ce641c255555e504c89a9f4d9956744 /Annex/Transfer.hs
parent549f635c6b64006b5a369795805d08b8f439d54c (diff)
convert from Utility.LockPool to Annex.LockPool everywhere
Diffstat (limited to 'Annex/Transfer.hs')
-rw-r--r--Annex/Transfer.hs14
1 files changed, 8 insertions, 6 deletions
diff --git a/Annex/Transfer.hs b/Annex/Transfer.hs
index e72f737ea..2b0c12c8a 100644
--- a/Annex/Transfer.hs
+++ b/Annex/Transfer.hs
@@ -23,7 +23,7 @@ import Logs.Transfer as X
import Annex.Notification as X
import Annex.Perms
import Utility.Metered
-import Utility.LockPool
+import Annex.LockPool
import Types.Remote (Verification(..))
import Control.Concurrent
@@ -79,7 +79,7 @@ runTransfer' ignorelock t file shouldretry transferobserver transferaction = do
info <- liftIO $ startTransferInfo file
(meter, tfile, metervar) <- mkProgressUpdater t info
mode <- annexFileMode
- (lck, inprogress) <- liftIO $ prep tfile mode info
+ (lck, inprogress) <- prep tfile mode info
if inprogress && not ignorelock
then do
showNote "transfer already in progress, or unable to take transfer lock"
@@ -96,21 +96,23 @@ runTransfer' ignorelock t file shouldretry transferobserver transferaction = do
r <- tryLockExclusive (Just mode) lck
case r of
Nothing -> return (Nothing, True)
- Just lockhandle -> ifM (checkSaneLock lck lockhandle)
+ Just lockhandle -> ifM (liftIO $ checkSaneLock lck lockhandle)
( do
- void $ tryIO $ writeTransferInfoFile info tfile
+ void $ liftIO $ tryIO $
+ writeTransferInfoFile info tfile
return (Just lockhandle, False)
, return (Nothing, True)
)
#else
- prep tfile _mode info = do
+ prep tfile _mode info = liftIO $ do
let lck = transferLockFile tfile
v <- catchMaybeIO $ lockExclusive lck
case v of
Nothing -> return (Nothing, False)
Just Nothing -> return (Nothing, True)
Just (Just lockhandle) -> do
- void $ tryIO $ writeTransferInfoFile info tfile
+ void $ liftIO $ tryIO $
+ writeTransferInfoFile info tfile
return (Just lockhandle, False)
#endif
cleanup _ Nothing = noop