diff options
| author | bjorn <bjorn@bringert.net> | 2008-08-24 20:44:30 +0000 |
|---|---|---|
| committer | bjorn <bjorn@bringert.net> | 2008-08-24 20:44:30 +0000 |
| commit | d1ebdf8154855964b4dbeaca7791589b103fd621 (patch) | |
| tree | 47108d0d3d3ff58c03b677a7801233306e156e6f /src | |
| parent | b3ab690dddc76f3a33cc9c48d300518e73af041d (diff) | |
gf-server: the readData function given to getData should be m a, not IO a.
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/FastCGIUtils.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/FastCGIUtils.hs b/src/server/FastCGIUtils.hs index 2cf64af91..e95cad3f5 100644 --- a/src/server/FastCGIUtils.hs +++ b/src/server/FastCGIUtils.hs @@ -109,15 +109,15 @@ type DataRef a = IORef (Maybe (ClockTime, a)) newDataRef :: MonadIO m => m (DataRef a) newDataRef = liftIO $ newIORef Nothing -getData :: MonadIO m => (FilePath -> IO a) -> DataRef a -> FilePath -> m a -getData loadData ref file = liftIO $ - do t' <- getModificationTime file - m <- readIORef ref +getData :: MonadIO m => (FilePath -> m a) -> DataRef a -> FilePath -> m a +getData loadData ref file = + do t' <- liftIO $ getModificationTime file + m <- liftIO $ readIORef ref case m of Just (t,x) | t' == t -> return x _ -> do logCGI $ "Loading " ++ show file ++ "..." x <- loadData file - writeIORef ref (Just (t',x)) + liftIO $ writeIORef ref (Just (t',x)) return x -- Logging |
