diff options
| author | hallgren <hallgren@chalmers.se> | 2014-05-12 13:45:36 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2014-05-12 13:45:36 +0000 |
| commit | 7c9ff164bf89b6f39da5ad2c43f7772324e1c141 (patch) | |
| tree | 24fa537181f6a48274513b91d689c444a6570774 /src/server/Cache.hs | |
| parent | 12a8e113c2cc75e287677e8f0b3e30d364c612d5 (diff) | |
gf -server: include list of loaded PGFs in version info
Diffstat (limited to 'src/server/Cache.hs')
| -rw-r--r-- | src/server/Cache.hs | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
