summaryrefslogtreecommitdiff
path: root/src-interval
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2011-05-28 12:41:37 +0200
committerJasper Van der Jeugt <jaspervdj@gmail.com>2011-05-28 12:41:37 +0200
commit6ab59438123d00b02b5a04235102df7af2926cd4 (patch)
tree9e453864d8dfd01bbfe915b33bee0289bba04d7f /src-interval
parentb80ba8fe83220d373e639be363143cbbfd907081 (diff)
downloadhakyll-6ab59438123d00b02b5a04235102df7af2926cd4.tar.gz
Remove inotify bindings for now
Diffstat (limited to 'src-interval')
-rw-r--r--src-interval/Hakyll/Web/Preview/Poll.hs35
1 files changed, 0 insertions, 35 deletions
diff --git a/src-interval/Hakyll/Web/Preview/Poll.hs b/src-interval/Hakyll/Web/Preview/Poll.hs
deleted file mode 100644
index 68ea8d4..0000000
--- a/src-interval/Hakyll/Web/Preview/Poll.hs
+++ /dev/null
@@ -1,35 +0,0 @@
--- | Interval-based implementation of preview polling, for the platforms which
--- are not supported by inotify.
---
-module Hakyll.Web.Preview.Poll
- ( previewPoll
- ) where
-
-import Control.Applicative ((<$>))
-import Control.Concurrent (threadDelay)
-import Control.Monad (filterM)
-import System.Time (getClockTime)
-import System.Directory (getModificationTime, doesFileExist)
-
-import Hakyll.Core.Configuration
-
--- | A preview thread that periodically recompiles the site.
---
-previewPoll :: HakyllConfiguration -- ^ Configuration
- -> IO [FilePath] -- ^ Updating action
- -> IO () -- ^ Can block forever
-previewPoll _ update = do
- time <- getClockTime
- loop time =<< update
- where
- delay = 1000000
- loop time files = do
- threadDelay delay
- files' <- filterM doesFileExist files
- filesTime <- case files' of
- [] -> return time
- _ -> maximum <$> mapM getModificationTime files'
-
- if filesTime > time || files' /= files
- then loop filesTime =<< update
- else loop time files'