diff options
author | Joey Hess <joey@kitenet.net> | 2012-08-28 14:19:11 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-08-28 14:19:11 -0400 |
commit | 1296cfb09a763878e7b9376f59aabf60fb8d7314 (patch) | |
tree | 01123e18dd0ae4419100f75cca2036387179e0c8 /Assistant/Threads | |
parent | 7024a973b222c32f44a7168532afae520e7474ed (diff) |
avoid possibly re-adding a removed transfer when updating its info
Doesn't fix the bug I thought it'd fix, but is clearly correct.
Diffstat (limited to 'Assistant/Threads')
-rw-r--r-- | Assistant/Threads/TransferPoller.hs | 3 | ||||
-rw-r--r-- | Assistant/Threads/TransferWatcher.hs | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/Assistant/Threads/TransferPoller.hs b/Assistant/Threads/TransferPoller.hs index d720bcc45..12394373f 100644 --- a/Assistant/Threads/TransferPoller.hs +++ b/Assistant/Threads/TransferPoller.hs @@ -41,8 +41,7 @@ transferPollerThread st dstatus = do sz <- catchMaybeIO $ fromIntegral . fileSize <$> getFileStatus f - when (bytesComplete info /= sz && isJust sz) $ do - putStrLn $ "download size " ++ show sz + when (bytesComplete info /= sz && isJust sz) $ updateTransferInfo dstatus t info { bytesComplete = sz } {- can't poll uploads -} diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs index fe8af9aad..31116a724 100644 --- a/Assistant/Threads/TransferWatcher.hs +++ b/Assistant/Threads/TransferWatcher.hs @@ -64,7 +64,7 @@ onAdd st dstatus file _ = case parseTransferFile file of ] r <- headMaybe . filter (sameuuid t) . knownRemotes <$> getDaemonStatus dstatus - updateTransferInfo dstatus t info + alterTransferInfo dstatus t info { transferRemote = r } sameuuid t r = Remote.uuid r == transferUUID t |