summaryrefslogtreecommitdiff
path: root/src/Hakyll/Core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Core')
-rw-r--r--src/Hakyll/Core/Compiler.hs7
-rw-r--r--src/Hakyll/Core/Run.hs2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/Hakyll/Core/Compiler.hs b/src/Hakyll/Core/Compiler.hs
index 57a6d07..0c13c78 100644
--- a/src/Hakyll/Core/Compiler.hs
+++ b/src/Hakyll/Core/Compiler.hs
@@ -43,8 +43,11 @@ runCompiler :: Compiler () CompiledItem -- ^ Compiler to run
-> Bool -- ^ Was the resource modified?
-> IO CompiledItem -- ^ Resulting item
runCompiler compiler identifier provider lookup' route store modified = do
+ -- Run the compiler job
CompiledItem result <- runCompilerJob
compiler identifier provider lookup' route store modified
+
+ -- Store a copy in the cache and return
storeSet store "Hakyll.Core.Compiler.runCompiler" identifier result
return $ CompiledItem result
@@ -81,7 +84,9 @@ getDependencyOrResult identifier = CompilerM $ do
Nothing -> fmap (fromMaybe error') $ liftIO $
storeGet store "Hakyll.Core.Compiler.runCompiler" identifier
where
- error' = error "Hakyll.Core.Compiler.getDependency: Not found"
+ error' = error $ "Hakyll.Core.Compiler.getDependency: "
+ ++ show identifier
+ ++ " not found in the cache, the cache might be corrupted"
-- | Require another target. Using this function ensures automatic handling of
-- dependencies
diff --git a/src/Hakyll/Core/Run.hs b/src/Hakyll/Core/Run.hs
index c5e6489..9e6a6ee 100644
--- a/src/Hakyll/Core/Run.hs
+++ b/src/Hakyll/Core/Run.hs
@@ -108,6 +108,8 @@ hakyllWith rules provider store = do
dependencyLookup map' id' = M.lookup id' map'
+-- | Return a set of modified identifiers
+--
modified :: ResourceProvider -- ^ Resource provider
-> Store -- ^ Store
-> [Identifier] -- ^ Identifiers to check