diff --git a/guide.cabal b/guide.cabal index 61d63f7..60d904f 100644 --- a/guide.cabal +++ b/guide.cabal @@ -42,7 +42,7 @@ executable guide -- other-extensions: build-depends: MonadRandom == 0.4.* , Spock - , Spock-lucid == 0.2.* + , Spock-lucid == 0.3.* , acid-state == 0.14.* , aeson == 0.11.* , aeson-pretty == 0.7.* @@ -65,7 +65,6 @@ executable guide , http-types , ilist , iproute == 1.7.* - , list-t , lucid >= 2.9.5 && < 3 , megaparsec == 4.4.* , microlens-platform >= 0.3.2 @@ -79,7 +78,7 @@ executable guide , safecopy , shortcut-links >= 0.4.2 , split - , stm-containers == 0.2.10.* + , stm-containers >= 0.2.14 && < 0.3 , template-haskell , text-all == 0.3.* , time >= 1.5 diff --git a/src/Cache.hs b/src/Cache.hs index 40672d4..01e3560 100644 --- a/src/Cache.hs +++ b/src/Cache.hs @@ -26,7 +26,6 @@ import qualified Data.ByteString.Lazy as BSL -- Concurrent map import qualified STMContainers.Map as STMMap import Data.Hashable -import qualified ListT -- Lucid import Lucid.Base @@ -110,11 +109,8 @@ invalidateCache gs key = liftIO $ atomically $ do for_ (cacheDepends gs key) $ \k -> STMMap.delete k cache --- TODO: Should be easier once --- https://github.com/nikita-volkov/stm-containers/issues/6 is closed. emptyCache :: MonadIO m => m () -emptyCache = liftIO $ atomically $ - ListT.traverse_ (\(k,_) -> STMMap.delete k cache) (STMMap.stream cache) +emptyCache = liftIO $ atomically $ STMMap.deleteAll cache cached :: MonadIO m => CacheKey -> HtmlT m () -> HtmlT m () cached key gen = do