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.
This commit is contained in:
Joey Hess 2012-08-28 14:19:11 -04:00
parent 7024a973b2
commit 1296cfb09a
4 changed files with 22 additions and 13 deletions

View file

@ -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 -}

View file

@ -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