mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-29 22:42:52 -06:00
gf -server: add a command to manually flush the PGF cache
This can be used if the cloud service seems slow, but it would probably be better to automatically expire unused PGFs from the cache after some time.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
module PGFService(cgiMain,cgiMain',getPath,
|
||||
logFile,stderrToFile,
|
||||
newPGFCache) where
|
||||
newPGFCache,flushPGFCache) where
|
||||
|
||||
import PGF (PGF)
|
||||
import qualified PGF
|
||||
@@ -51,10 +51,12 @@ newPGFCache = do pgfCache <- newCache PGF.readPGF
|
||||
pc <- newMVar Map.empty
|
||||
return (pgf,pc)
|
||||
return (pgfCache,cCache)
|
||||
flushPGFCache (c1,c2) = flushCache c1 >> flushCache c2
|
||||
#else
|
||||
type Caches = (Cache PGF,())
|
||||
newPGFCache = do pgfCache <- newCache PGF.readPGF
|
||||
return (pgfCache,())
|
||||
flushPGFCache (c1,_) = flushCache c1
|
||||
#endif
|
||||
|
||||
getPath =
|
||||
|
||||
Reference in New Issue
Block a user