diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-10 16:02:16 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-10 16:02:16 -0400 |
commit | c931c2137efd59d4f931c75578effa9cfc18854c (patch) | |
tree | 74fe000ab70d380be34cc4481de20e5972452b56 /Utility/WebApp.hs | |
parent | 30cf4d4df7a4fda22e997366731af910f9996c78 (diff) |
use clientSessionBackend2 where available
avoids a warning, which says it's faster
Diffstat (limited to 'Utility/WebApp.hs')
-rw-r--r-- | Utility/WebApp.hs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs index 29daacab1..e7a43eade 100644 --- a/Utility/WebApp.hs +++ b/Utility/WebApp.hs @@ -140,9 +140,17 @@ webAppSessionBackend _ = do Left e -> error $ "failed to generate random key: " ++ show e Right (s, _) -> case CS.initKey s of Left e -> error $ "failed to initialize key: " ++ show e - Right key -> return $ Just $ - - Yesod.clientSessionBackend key 120 + Right key -> use key + where + timeout = 120 * 60 -- 120 minutes + use key = +#if MIN_VERSION_yesod(1,1,7) + Just . Yesod.clientSessionBackend2 key . fst + <$> Yesod.clientSessionDateCacher timeout +#else + return $ Just $ + Yesod.clientSessionBackend key timeout +#endif {- Generates a random sha512 string, suitable to be used for an - authentication secret. -} |