@@ -1,5 +1,6 @@
11-- | Interval-based implementation of preview polling
22--
3+{-# LANGUAGE CPP #-}
34module Hakyll.Web.Preview.Poll
45 ( previewPoll
56 ) where
@@ -7,7 +8,11 @@ module Hakyll.Web.Preview.Poll
78import Control.Applicative ((<$>))
89import Control.Concurrent (threadDelay)
910import Control.Monad (filterM)
11+#if MIN_VERSION_directory(1,2,0)
12+import Data.Time (getCurrentTime)
13+#else
1014import System.Time (getClockTime)
15+#endif
1116import System.Directory (getModificationTime, doesFileExist)
1217
1318import Hakyll.Core.Configuration
@@ -18,7 +23,11 @@ previewPoll :: HakyllConfiguration -- ^ Configuration
1823 -> IO [FilePath] -- ^ Updating action
1924 -> IO () -- ^ Can block forever
2025previewPoll _ update = do
26+#if MIN_VERSION_directory(1,2,0)
27+ time <- getCurrentTime
28+#else
2129 time <- getClockTime
30+#endif
2231 loop time =<< update
2332 where
2433 delay = 1000000