From c575a2d9fe9eab97c6af7d20c577b6ea6a0e72aa Mon Sep 17 00:00:00 2001 From: Lia Lenckowski Date: Sun, 15 Oct 2023 18:22:22 +0200 Subject: revert dumme sachen die eh nicht vollständig waren MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Main.hs | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'src/Main.hs') diff --git a/src/Main.hs b/src/Main.hs index 095cdbe..d69ced6 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -150,21 +150,20 @@ sendPendingBangs cfg pool = do "Please do something about it.\n" main :: IO () -main = do - cfg <- getConfig - runStdoutLoggingT $ withSqlitePool (confDbPath cfg) 2 $ \pool -> do - runResourceT $ flip runSqlPool pool $ runMigration migrateAll +main = runStdoutLoggingT $ withSqlitePool "banger.db" 2 $ \pool -> do + runResourceT $ flip runSqlPool pool $ runMigration migrateAll - bs <- liftIO initBangState - $(logInfo) $ "Using config: " <> T.pack (show cfg) + bs <- liftIO initBangState + cfg <- liftIO getConfig + $(logInfo) $ "Using config: " <> T.pack (show cfg) - sendPbIO <- toIO $ sendPendingBangs cfg pool - notifyPb <- liftIO $ makeRunner sendPbIO 600000000 {- 10 min -} + sendPbIO <- toIO $ sendPendingBangs cfg pool + notifyPb <- liftIO $ makeRunner sendPbIO 600000000 {- 10 min -} - sApp <- liftIO $ toWaiApp $ Search bs pool cfg notifyPb -- includes middlewares + sApp <- liftIO $ toWaiApp $ Search bs pool cfg notifyPb -- includes middlewares - let settings = defaultSettings - & setHost (confHost cfg) - & setPort (confPort cfg) + let settings = defaultSettings + & setHost (confHost cfg) + & setPort (confPort cfg) - liftIO $ runSettings settings sApp + liftIO $ runSettings settings sApp -- cgit v1.2.3-70-g09d2