fix
This commit is contained in:
parent
721748135b
commit
8795a392c3
1 changed files with 3 additions and 11 deletions
|
@ -47,13 +47,7 @@ runHandler st dstatus handler file filestatus = void $ do
|
||||||
onErr :: Handler
|
onErr :: Handler
|
||||||
onErr _ _ msg _ = error msg
|
onErr _ _ msg _ = error msg
|
||||||
|
|
||||||
{- Called when a new transfer information file is written.
|
{- 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.
|
|
||||||
-}
|
|
||||||
onAdd :: Handler
|
onAdd :: Handler
|
||||||
onAdd st dstatus file _ = case parseTransferFile file of
|
onAdd st dstatus file _ = case parseTransferFile file of
|
||||||
Nothing -> noop
|
Nothing -> noop
|
||||||
|
@ -62,10 +56,8 @@ onAdd st dstatus file _ = case parseTransferFile file of
|
||||||
runThreadState st $ go t pid =<< checkTransfer t
|
runThreadState st $ go t pid =<< checkTransfer t
|
||||||
where
|
where
|
||||||
go _ _ Nothing = noop -- transfer already finished
|
go _ _ Nothing = noop -- transfer already finished
|
||||||
go t pid (Just info)
|
go t pid (Just info) = adjustTransfers dstatus $
|
||||||
| transferPid info == Just pid = noop
|
M.insertWith' const t info
|
||||||
| otherwise = adjustTransfers dstatus $
|
|
||||||
M.insertWith' const t info
|
|
||||||
|
|
||||||
{- Called when a transfer information file is removed. -}
|
{- Called when a transfer information file is removed. -}
|
||||||
onDel :: Handler
|
onDel :: Handler
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue