summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Watcher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-30 17:14:26 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-30 17:14:51 -0400
commit4318f594d544320825093de8661ed1b40e4774d5 (patch)
tree709dcd2fe739c503651bc7bd5e1df35a52a27977 /Assistant/Threads/Watcher.hs
parent07cd1b2b40735d460c8225762fcf3992b9886c60 (diff)
finished pushing Assistant monad into all relevant files
All temporary and old functions are removed.
Diffstat (limited to 'Assistant/Threads/Watcher.hs')
-rw-r--r--Assistant/Threads/Watcher.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs
index 7dcde1f46..a74976deb 100644
--- a/Assistant/Threads/Watcher.hs
+++ b/Assistant/Threads/Watcher.hs
@@ -54,7 +54,7 @@ needLsof = error $ unlines
watchThread :: NamedThread
watchThread = NamedThread "Watcher" $ do
- startup <- asIO startupScan
+ startup <- asIO1 startupScan
addhook <- hook onAdd
delhook <- hook onDel
addsymlinkhook <- hook onAddSymlink
@@ -182,12 +182,9 @@ onAddSymlink file filestatus = go =<< liftAnnex (Backend.lookupFile file)
checkcontent key daemonstatus
| scanComplete daemonstatus = do
present <- liftAnnex $ inAnnex key
- dstatus <- getAssistant daemonStatusHandle
- unless present $ do
- transferqueue <- getAssistant transferQueue
- liftAnnex $ queueTransfers Next transferqueue
- dstatus key (Just file) Download
- liftAnnex $ handleDrops dstatus present key (Just file)
+ unless present $
+ queueTransfers Next key (Just file) Download
+ handleDrops present key (Just file)
| otherwise = noop
onDel :: Handler