diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-30 15:39:15 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-30 15:39:15 -0400 |
commit | 07cd1b2b40735d460c8225762fcf3992b9886c60 (patch) | |
tree | c08c38417dfd9cba94ac56e212fa9d5864927ac0 /Assistant/Threads/TransferWatcher.hs | |
parent | bab7e83221468905b76e28bb123ebe26e146b97b (diff) |
pushed Assistant monad down into DaemonStatus code
Currently have three old versions of functions that more reworking is
needed to remove: getDaemonStatusOld, modifyDaemonStatusOld_, and
modifyDaemonStatusOld
Diffstat (limited to 'Assistant/Threads/TransferWatcher.hs')
-rw-r--r-- | Assistant/Threads/TransferWatcher.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs index a9925c9e5..f18a2acd8 100644 --- a/Assistant/Threads/TransferWatcher.hs +++ b/Assistant/Threads/TransferWatcher.hs @@ -64,8 +64,7 @@ onAdd file = case parseTransferFile file of debug [ "transfer starting:", show t] r <- headMaybe . filter (sameuuid t) <$> liftAnnex Remote.remoteList - dstatus <- getAssistant daemonStatusHandle - liftIO $ updateTransferInfo dstatus t info { transferRemote = r } + updateTransferInfo t info { transferRemote = r } sameuuid t r = Remote.uuid r == transferUUID t {- Called when a transfer information file is updated. @@ -79,9 +78,8 @@ onModify file = do Just t -> go t =<< liftIO (readTransferInfoFile Nothing file) where go _ Nothing = noop - go t (Just newinfo) = withAssistant daemonStatusHandle $ \h -> - alterTransferInfo h t $ - \i -> i { bytesComplete = bytesComplete newinfo } + go t (Just newinfo) = alterTransferInfo t $ + \i -> i { bytesComplete = bytesComplete newinfo } {- This thread can only watch transfer sizes when the DirWatcher supports - tracking modificatons to files. -} @@ -94,7 +92,7 @@ onDel file = case parseTransferFile file of Nothing -> noop Just t -> do debug [ "transfer finishing:", show t] - minfo <- flip removeTransfer t <<~ daemonStatusHandle + minfo <- removeTransfer t finished <- asIO2 finishedTransfer void $ liftIO $ forkIO $ do |