From 7c9ff164bf89b6f39da5ad2c43f7772324e1c141 Mon Sep 17 00:00:00 2001 From: hallgren Date: Mon, 12 May 2014 13:45:36 +0000 Subject: gf -server: include list of loaded PGFs in version info --- src/server/Cache.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/server/Cache.hs') diff --git a/src/server/Cache.hs b/src/server/Cache.hs index bde07745a..c845bb013 100644 --- a/src/server/Cache.hs +++ b/src/server/Cache.hs @@ -1,4 +1,4 @@ -module Cache (Cache,newCache,flushCache,readCache,readCache') where +module Cache (Cache,newCache,flushCache,listCache,readCache,readCache') where import Control.Concurrent.MVar import Data.Map (Map) @@ -22,6 +22,9 @@ flushCache :: Cache a -> IO () flushCache c = do modifyMVar_ (cacheObjects c) (const (return Map.empty)) performGC +listCache :: Cache a -> IO [FilePath] +listCache = fmap Map.keys . readMVar . cacheObjects + readCache :: Cache a -> FilePath -> IO a readCache c file = snd `fmap` readCache' c file -- cgit v1.2.3