diff --git a/src/Main.hs b/src/Main.hs index 93db179..126da85 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -7,6 +7,7 @@ module Main where import Control.Concurrent (forkIO) import Control.Exception (onException) import Control.Exception (throwIO) +import Control.Monad (void) import Data.Acid (openLocalState) import Data.Acid.Remote (skipAuthenticationCheck, acidServerSockAddr, openRemoteStateSockAddr, skipAuthenticationPerform) import Data.IMF (Mailbox, parse, mailbox) @@ -38,7 +39,7 @@ serverMain socket mail repoPath sendmailPath = do queueMessages acid _ <- forkIO $ scotty 3000 $ do defaultHandler $ liftAndCatchIO . LT.putStrLn -- Don't return exceptions to clients - post "/" $ liftAndCatchIO $ updateMessages acid repoPath + post "/" $ liftAndCatchIO $ void $ forkIO $ updateMessages acid repoPath updateMessages acid repoPath _ <- forkIO $ manageQueueingMessages acid _ <- forkIO $ managePreviews acid mail sendmailPath