X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=Rakka.git;a=blobdiff_plain;f=Rakka%2FStorage%2FImpl.hs;h=bedc9eaa2808d3142e5d4abf91cd00d724369401;hp=e1bad11015a987b32d95d079594ae731550f85fb;hb=8631d8de8373ec8226d19019ae7cf3a1bf2e44e5;hpb=57f65ea30348628d11568e165550effc919d0a2d diff --git a/Rakka/Storage/Impl.hs b/Rakka/Storage/Impl.hs index e1bad11..bedc9ea 100644 --- a/Rakka/Storage/Impl.hs +++ b/Rakka/Storage/Impl.hs @@ -12,6 +12,7 @@ module Rakka.Storage.Impl import Control.Concurrent import Control.Concurrent.STM +import Control.Exception import Control.Monad import Data.Maybe import Data.Set (Set) @@ -107,7 +108,7 @@ startIndexManager :: FilePath -> Repository -> (Page -> IO Document) -> IO (TCha startIndexManager lsdir repos mkDraft = do chan <- newTChanIO index <- openIndex indexDir revFile - _ <- forkIO (loop chan index) + _ <- forkIO (loop chan index `finally` closeDatabase index) return chan where indexDir = lsdir "index"