clean up urlrenderer handling when the webapp is not built

This commit is contained in:
Joey Hess 2013-04-03 17:44:34 -04:00
parent 9a5f421768
commit 021c564319
7 changed files with 55 additions and 27 deletions

View file

@ -154,6 +154,7 @@ import Assistant.Threads.XMPPClient
#warning Building without the webapp. You probably need to install Yesod..
#endif
import Assistant.Environment
import Assistant.Types.UrlRenderer
import qualified Utility.Daemon
import Utility.LogFile
import Utility.ThreadScheduler
@ -205,15 +206,16 @@ startDaemon assistant foreground startbrowser = do
flip runAssistant (go webappwaiter)
=<< newAssistantData st dstatus
go webappwaiter = do
notice ["starting", desc, "version", SysConfig.packageversion]
#ifdef WITH_WEBAPP
go webappwaiter = do
d <- getAssistant id
urlrenderer <- liftIO newUrlRenderer
mapM_ (startthread $ Just urlrenderer)
#else
mapM_ (startthread Nothing)
go _webappwaiter = do
#endif
notice ["starting", desc, "version", SysConfig.packageversion]
urlrenderer <- liftIO newUrlRenderer
mapM_ (startthread urlrenderer)
[ watch $ commitThread
#ifdef WITH_WEBAPP
, assist $ webAppThread d urlrenderer False Nothing webappwaiter