Skip to content

Instantly share code, notes, and snippets.

@voidlizard
Created April 8, 2011 16:01
Show Gist options
  • Save voidlizard/910168 to your computer and use it in GitHub Desktop.
Save voidlizard/910168 to your computer and use it in GitHub Desktop.
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