summaryrefslogtreecommitdiff
path: root/src/server/PGFService.hs
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2014-03-19 16:15:05 +0000
committerhallgren <hallgren@chalmers.se>2014-03-19 16:15:05 +0000
commitb061d59044b0cc689cf270617364ab36c8a0792f (patch)
treeb3cf29ad4a7ae608be8b0de043fd055d7b046e5d /src/server/PGFService.hs
parentcbb538e170c9a7233e2ca438db8560d60fd91609 (diff)
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.
Diffstat (limited to 'src/server/PGFService.hs')
-rw-r--r--src/server/PGFService.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/PGFService.hs b/src/server/PGFService.hs
index 752035e87..2ca9b4ca2 100644
--- a/src/server/PGFService.hs
+++ b/src/server/PGFService.hs
@@ -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 =