summaryrefslogtreecommitdiff
path: root/Utility/DirWatcher/Win32Notify.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-05 17:44:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-05 17:44:14 -0400
commit1db1469905cd08da2b4a2f5e310437ff5233f286 (patch)
treedce09d0ef76f95819bfb8f3d2640c4121475c5fe /Utility/DirWatcher/Win32Notify.hs
parentf86866c6130ad7b8eb1433c976e4c94b1f17e30d (diff)
annex.startupscan can be set to false to disable the assistant's startup scan.
Diffstat (limited to 'Utility/DirWatcher/Win32Notify.hs')
-rw-r--r--Utility/DirWatcher/Win32Notify.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Utility/DirWatcher/Win32Notify.hs b/Utility/DirWatcher/Win32Notify.hs
index ba786839c..f095e5d0e 100644
--- a/Utility/DirWatcher/Win32Notify.hs
+++ b/Utility/DirWatcher/Win32Notify.hs
@@ -13,8 +13,8 @@ import Utility.DirWatcher.Types
import System.Win32.Notify
import qualified Utility.PosixFiles as Files
-watchDir :: FilePath -> (FilePath -> Bool) -> WatchHooks -> IO WatchManager
-watchDir dir ignored hooks = do
+watchDir :: FilePath -> (FilePath -> Bool) -> Bool -> WatchHooks -> IO WatchManager
+watchDir dir ignored scanevents hooks = do
scan dir
wm <- initWatchManager
void $ watchDirectory wm dir True [Create, Delete, Modify, Move] handle
@@ -52,7 +52,8 @@ watchDir dir ignored hooks = do
Nothing -> noop
Just s
| Files.isRegularFile s ->
- runhook addHook ms
+ when scanevents $
+ runhook addHook ms
| otherwise ->
noop
where