gf -server: include grammar modification time in the info returned by /version

This commit is contained in:
hallgren
2015-04-17 13:21:20 +00:00
parent 9e3afea129
commit 3263968c79
2 changed files with 8 additions and 4 deletions

View File

@@ -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)