diff options
Diffstat (limited to 'src/server/Cache.hs')
| -rw-r--r-- | src/server/Cache.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/Cache.hs b/src/server/Cache.hs index d7c806783..bde07745a 100644 --- a/src/server/Cache.hs +++ b/src/server/Cache.hs @@ -4,6 +4,7 @@ import Control.Concurrent.MVar import Data.Map (Map) import qualified Data.Map as Map import System.Directory (getModificationTime) +import System.Mem(performGC) import Data.Time (UTCTime) import Data.Time.Compat (toUTCTime) @@ -18,7 +19,8 @@ newCache load = return $ Cache { cacheLoad = load, cacheObjects = objs } flushCache :: Cache a -> IO () -flushCache c = modifyMVar_ (cacheObjects c) (const (return Map.empty)) +flushCache c = do modifyMVar_ (cacheObjects c) (const (return Map.empty)) + performGC readCache :: Cache a -> FilePath -> IO a readCache c file = snd `fmap` readCache' c file |
