From 1db1469905cd08da2b4a2f5e310437ff5233f286 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 5 Mar 2014 17:44:14 -0400 Subject: annex.startupscan can be set to false to disable the assistant's startup scan. --- Assistant/Threads/Merger.hs | 2 +- Assistant/Threads/TransferWatcher.hs | 2 +- Assistant/Threads/UpgradeWatcher.hs | 3 ++- Assistant/Threads/Watcher.hs | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'Assistant') diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs index 12489b590..03bcf0aad 100644 --- a/Assistant/Threads/Merger.hs +++ b/Assistant/Threads/Merger.hs @@ -39,7 +39,7 @@ mergeThread = namedThread "Merger" $ do , modifyHook = changehook , errHook = errhook } - void $ liftIO $ watchDir dir (const False) hooks id + void $ liftIO $ watchDir dir (const False) True hooks id debug ["watching", dir] type Handler = FilePath -> Assistant () diff --git a/Assistant/Threads/TransferWatcher.hs b/Assistant/Threads/TransferWatcher.hs index cd7282865..6e8791732 100644 --- a/Assistant/Threads/TransferWatcher.hs +++ b/Assistant/Threads/TransferWatcher.hs @@ -35,7 +35,7 @@ transferWatcherThread = namedThread "TransferWatcher" $ do , modifyHook = modifyhook , errHook = errhook } - void $ liftIO $ watchDir dir (const False) hooks id + void $ liftIO $ watchDir dir (const False) True hooks id debug ["watching for transfers"] type Handler = FilePath -> Assistant () diff --git a/Assistant/Threads/UpgradeWatcher.hs b/Assistant/Threads/UpgradeWatcher.hs index 80f2040a0..ffad09d3d 100644 --- a/Assistant/Threads/UpgradeWatcher.hs +++ b/Assistant/Threads/UpgradeWatcher.hs @@ -50,8 +50,9 @@ upgradeWatcherThread urlrenderer = namedThread "UpgradeWatcher" $ do let dir = parentDir flagfile let depth = length (splitPath dir) + 1 let nosubdirs f = length (splitPath f) == depth - void $ liftIO $ watchDir dir nosubdirs hooks (startup mvar) + void $ liftIO $ watchDir dir nosubdirs False hooks (startup mvar) -- Ignore bogus events generated during the startup scan. + -- We ask the watcher to not generate them, but just to be safe.. startup mvar scanner = do r <- scanner void $ swapMVar mvar Started diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs index 611eca1a7..8a8e8faf0 100644 --- a/Assistant/Threads/Watcher.hs +++ b/Assistant/Threads/Watcher.hs @@ -102,7 +102,8 @@ runWatcher = do , delDirHook = deldirhook , errHook = errhook } - handle <- liftIO $ watchDir "." ignored hooks startup + scanevents <- liftAnnex $ annexStartupScan <$> Annex.getGitConfig + handle <- liftIO $ watchDir "." ignored scanevents hooks startup debug [ "watching", "."] {- Let the DirWatcher thread run until signalled to pause it, -- cgit v1.2.3