refactor(tazblog): Directly instantiate Resolver when launching

Caching behaviour is tied to the resolver.
This commit is contained in:
Vincent Ambo 2019-08-21 11:07:25 +01:00
parent bf2efeba2d
commit 008be5c2e1
2 changed files with 25 additions and 7 deletions

View file

@ -29,8 +29,8 @@ tmpPolicy = defaultBodyPolicy "/tmp" 0 200000 1000
runBlog :: Int -> String -> IO ()
runBlog port respath = do
cache <- newCache "blog.tazj.in."
simpleHTTP nullConf {port = port} $ tazBlog cache respath
withCache "blog.tazj.in." $ \cache ->
simpleHTTP nullConf {port = port} $ tazBlog cache respath
tazBlog :: BlogCache -> String -> ServerPart Response
tazBlog cache resDir = do