diff --git a/Annex/Transfer.hs b/Annex/Transfer.hs index 76d93df00f..e6a6e4c806 100644 --- a/Annex/Transfer.hs +++ b/Annex/Transfer.hs @@ -205,13 +205,8 @@ runTransfer' ignorelock t afile stalldetection retrydecider transferaction = , return observeFailure ) - getbytescomplete metervar - | transferDirection t == Upload = - liftIO $ maybe 0 fromBytesProcessed - <$> readTVarIO metervar - | otherwise = do - f <- fromRepo $ gitAnnexTmpObjectLocation (transferKey t) - liftIO $ catchDefaultIO 0 $ getFileSize f + getbytescomplete metervar = liftIO $ + maybe 0 fromBytesProcessed <$> readTVarIO metervar detectStallsAndSuggestConfig :: Maybe StallDetection -> TVar (Maybe BytesProcessed) -> Annex a -> Annex a detectStallsAndSuggestConfig Nothing _ a = a diff --git a/Annex/TransferrerPool.hs b/Annex/TransferrerPool.hs index 01f479881d..513dc1f28e 100644 --- a/Annex/TransferrerPool.hs +++ b/Annex/TransferrerPool.hs @@ -133,12 +133,8 @@ performTransfer stalldetection level runannex r t info transferrer = do ifM (catchBoolIO $ bracket setup cleanup (go bpv)) ( return (Right ()) , do - n <- case transferDirection t of - Upload -> liftIO $ atomically $ - fromBytesProcessed <$> readTVar bpv - Download -> do - f <- runannex $ fromRepo $ gitAnnexTmpObjectLocation (transferKey t) - liftIO $ catchDefaultIO 0 $ getFileSize f + n <- liftIO $ atomically $ + fromBytesProcessed <$> readTVar bpv return $ Left $ info { bytesComplete = Just n } ) where diff --git a/Messages/Serialized.hs b/Messages/Serialized.hs index bf1d09578a..0f5faddc9f 100644 --- a/Messages/Serialized.hs +++ b/Messages/Serialized.hs @@ -32,7 +32,7 @@ relaySerializedOutput -> (SerializedOutputResponse -> m ()) -- ^ Send response to child process. -> (Maybe BytesProcessed -> m ()) - -- ^ When a progress meter is running, is updated with + -- ^ When a progress meter is running, it is updated with -- progress meter values sent by the process. -- When a progress meter is stopped, Nothing is sent. -> (forall a. Annex a -> m a)