summaryrefslogtreecommitdiff
path: root/Assistant/Threads/TransferWatcher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-06 16:30:55 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-06 16:30:55 -0400
commit8795a392c3f283d8e372cac3d82d29ca52c9cfb5 (patch)
treed635a8444ad6af4175814d1e60ec489e00afb9a3 /Assistant/Threads/TransferWatcher.hs
parent721748135b80a20e78ddc780ffedb2c54b74c307 (diff)
fix
Diffstat (limited to 'Assistant/Threads/TransferWatcher.hs')
-rw-r--r--Assistant/Threads/TransferWatcher.hs14
1 files changed, 3 insertions, 11 deletions
diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs
index f18d4e3f8..48c0c79ae 100644
--- a/Assistant/Threads/TransferWatcher.hs
+++ b/Assistant/Threads/TransferWatcher.hs
@@ -47,13 +47,7 @@ runHandler st dstatus handler file filestatus = void $ do
onErr :: Handler
onErr _ _ msg _ = error msg
-{- Called when a new transfer information file is written.
- -
- - When another thread of the assistant writes a transfer info file,
- - this will notice that too, but should skip it, because the thread
- - will be managing the transfer itself, and will have stored a more
- - complete TransferInfo than is stored in the file.
- -}
+{- Called when a new transfer information file is written. -}
onAdd :: Handler
onAdd st dstatus file _ = case parseTransferFile file of
Nothing -> noop
@@ -62,10 +56,8 @@ onAdd st dstatus file _ = case parseTransferFile file of
runThreadState st $ go t pid =<< checkTransfer t
where
go _ _ Nothing = noop -- transfer already finished
- go t pid (Just info)
- | transferPid info == Just pid = noop
- | otherwise = adjustTransfers dstatus $
- M.insertWith' const t info
+ go t pid (Just info) = adjustTransfers dstatus $
+ M.insertWith' const t info
{- Called when a transfer information file is removed. -}
onDel :: Handler