Created
April 8, 2011 16:01
-
-
Save voidlizard/910168 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main :: IO () | |
main = do | |
putStrLn "Init sessions..." | |
ctx <- newDbContext viewKeys | |
sd <- loadSessionData ctx | |
st <- initState ctx $ sessionsFromList sd | |
let reloadSessions = do | |
putStrLn "Reload sessions" | |
-- ctx' <- newDbContext viewKeys | |
-- sd' <- loadSessionData ctx' | |
-- updateSessionsToState st $ sessionsFromList [] | |
putStrLn "Init cron..." | |
withThread (Cron.cron 5 reloadSessions) $ do | |
putStrLn "Init cron done" | |
simpleHTTP' (\f -> runReaderT f st) srvConf $ msum [ dir "list" $ path $ listEntity |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment