From 3263968c7985168772875ea1b005425c044cc52d Mon Sep 17 00:00:00 2001 From: hallgren Date: Fri, 17 Apr 2015 13:21:20 +0000 Subject: gf -server: include grammar modification time in the info returned by /version --- src/server/Cache.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/server/Cache.hs') diff --git a/src/server/Cache.hs b/src/server/Cache.hs index d841a2291..d05ee2557 100644 --- a/src/server/Cache.hs +++ b/src/server/Cache.hs @@ -38,11 +38,13 @@ expireCache age c = performGC -- | List currently cached files -listCache :: Cache a -> IO [FilePath] +listCache :: Cache a -> IO [(FilePath,UTCTime)] listCache c = fmap (mapMaybe id) . mapM check . Map.toList =<< readMVar (cacheObjects c) where - check (path,v) = maybe Nothing (const (Just path)) `fmap` readMVar v + check (path,v) = maybe Nothing (Just . (,) path . fst3) `fmap` readMVar v + +fst3 (x,y,z) = x -- | Lookup a cached object (or read the file if it is not in the cache or if -- it has been modified) -- cgit v1.2.3