summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornoxx <noxx@noxx-inferno.(none)>2013-05-04 13:05:47 +0300
committernoxx <noxx@noxx-inferno.(none)>2013-05-04 13:05:47 +0300
commit0f779a8c53039829030eb984528974d80372002d (patch)
tree3e669fffb929937459f4990ba968e201d0395456 /src
parenta3021bc703d8a60a2e6467afce6691ee039f3612 (diff)
downloadhakyll-0f779a8c53039829030eb984528974d80372002d.tar.gz
Added isMember to load function
Diffstat (limited to 'src')
-rw-r--r--src/Hakyll/Core/Provider/MetadataCache.hs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Hakyll/Core/Provider/MetadataCache.hs b/src/Hakyll/Core/Provider/MetadataCache.hs
index 077bad2..031960c 100644
--- a/src/Hakyll/Core/Provider/MetadataCache.hs
+++ b/src/Hakyll/Core/Provider/MetadataCache.hs
@@ -8,7 +8,7 @@ module Hakyll.Core.Provider.MetadataCache
--------------------------------------------------------------------------------
import qualified Data.Map as M
-
+import Control.Monad (unless)
--------------------------------------------------------------------------------
import Hakyll.Core.Identifier
@@ -49,12 +49,8 @@ resourceInvalidateMetadataCache p r = do
--------------------------------------------------------------------------------
load :: Provider -> Identifier -> IO ()
load p r = do
- mmd <- Store.get store mdk :: IO (Store.Result Metadata)
- case mmd of
- -- Already loaded
- Store.Found _ -> return ()
- -- Not yet loaded
- _ -> do
+ mmof <- Store.isMember store mdk
+ unless mmof $ do
(md, body) <- loadMetadata p r
Store.set store mdk md
Store.set store bk body