diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-29 02:21:04 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-29 02:21:04 -0400 |
commit | 579f63b6b756ca51b8f9fe53c3e668500718d91f (patch) | |
tree | 20039581df67e034ef434749d37de41e9802d21d /Assistant/Threads/Watcher.hs | |
parent | 040f68d628120e112e22bfb7100f9650dec940c8 (diff) |
Assistant monad, stage 2.5
Converted several threads to run in the monad.
Added a lot of useful combinators for working with the monad.
Now the monad includes the name of the thread.
Some debugging messages are disabled pending converting other threads.
Diffstat (limited to 'Assistant/Threads/Watcher.hs')
-rw-r--r-- | Assistant/Threads/Watcher.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs index 5d24fe23f..7ab124b14 100644 --- a/Assistant/Threads/Watcher.hs +++ b/Assistant/Threads/Watcher.hs @@ -56,9 +56,9 @@ needLsof = error $ unlines ] watchThread :: ThreadState -> DaemonStatusHandle -> TransferQueue -> ChangeChan -> NamedThread -watchThread st dstatus transferqueue changechan = NamedThread thisThread $ do +watchThread st dstatus transferqueue changechan = NamedThread thisThread $ liftIO $ do void $ watchDir "." ignored hooks startup - debug thisThread [ "watching", "."] + brokendebug thisThread [ "watching", "."] where startup = startupScan st dstatus hook a = Just $ runHandler thisThread st dstatus transferqueue changechan a @@ -132,7 +132,7 @@ onAddSymlink threadname file filestatus dstatus transferqueue = go =<< Backend.l checkcontent key s ensurestaged link s , do - liftIO $ debug threadname ["fix symlink", file] + liftIO $ brokendebug threadname ["fix symlink", file] liftIO $ removeFile file liftIO $ createSymbolicLink link file checkcontent key =<< liftIO (getDaemonStatus dstatus) @@ -162,7 +162,7 @@ onAddSymlink threadname file filestatus dstatus transferqueue = go =<< Backend.l {- For speed, tries to reuse the existing blob for symlink target. -} addlink link = do - liftIO $ debug threadname ["add symlink", file] + liftIO $ brokendebug threadname ["add symlink", file] v <- catObjectDetails $ Ref $ ':':file case v of Just (currlink, sha) @@ -187,7 +187,7 @@ onAddSymlink threadname file filestatus dstatus transferqueue = go =<< Backend.l onDel :: Handler onDel threadname file _ _dstatus _ = do - liftIO $ debug threadname ["file deleted", file] + liftIO $ brokendebug threadname ["file deleted", file] Annex.Queue.addUpdateIndex =<< inRepo (Git.UpdateIndex.unstageFile file) madeChange file RmChange @@ -201,7 +201,7 @@ onDel threadname file _ _dstatus _ = do - just as good. -} onDelDir :: Handler onDelDir threadname dir _ _dstatus _ = do - liftIO $ debug threadname ["directory deleted", dir] + liftIO $ brokendebug threadname ["directory deleted", dir] Annex.Queue.addCommand "rm" [Params "--quiet -r --cached --ignore-unmatch --"] [dir] madeChange dir RmDirChange |