make tor hidden service work when directory watching is not available
Avoid crashing when built w/o inotify..
This commit is contained in:
parent
8ac4126bd2
commit
9dd510bf29
4 changed files with 22 additions and 18 deletions
|
@ -71,7 +71,7 @@ stopWatchingChangedRefs h@(ChangedRefsHandle wh chan) = do
|
|||
atomically $ closeTBMChan chan
|
||||
drainChangedRefs h
|
||||
|
||||
watchChangedRefs :: Annex ChangedRefsHandle
|
||||
watchChangedRefs :: Annex (Maybe ChangedRefsHandle)
|
||||
watchChangedRefs = do
|
||||
-- This channel is used to accumulate notifications,
|
||||
-- because the DirWatcher might have multiple threads that find
|
||||
|
@ -90,8 +90,11 @@ watchChangedRefs = do
|
|||
, modifyHook = notifyhook
|
||||
}
|
||||
|
||||
h <- liftIO $ watchDir refdir (const False) True hooks id
|
||||
return $ ChangedRefsHandle h chan
|
||||
if canWatch
|
||||
then do
|
||||
h <- liftIO $ watchDir refdir (const False) True hooks id
|
||||
return $ Just $ ChangedRefsHandle h chan
|
||||
else return Nothing
|
||||
|
||||
notifyHook :: TBMChan Git.Sha -> FilePath -> Maybe FileStatus -> IO ()
|
||||
notifyHook chan reffile _
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue