about summary refs log tree commit diff
path: root/users/Profpatsch/whatcd-resolver/src
diff options
context:
space:
mode:
Diffstat (limited to 'users/Profpatsch/whatcd-resolver/src')
-rw-r--r--users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
index 0d9e84d00fc6..4dae268527ba 100644
--- a/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
+++ b/users/Profpatsch/whatcd-resolver/src/WhatcdResolver.hs
@@ -55,6 +55,16 @@ import Text.Blaze.Html5 qualified as Html
 import Tool (Tool, readTool, readTools)
 import UnliftIO
 
+main :: IO ()
+main =
+  runAppWith
+    ( do
+        _ <- runTransaction migrate
+        htmlUi
+    )
+    <&> first showToError
+    >>= expectIOError "could not start whatcd-resolver"
+
 htmlUi :: App ()
 htmlUi = do
   let debug = True
@@ -600,16 +610,6 @@ redactedGetTorrentFile dat =
         )
     )
 
-test :: Bool -> IO (Either TmpPg.StartError ())
-test doSearch =
-  runAppWith $ do
-    _ <- runTransaction migrate
-    when doSearch $ do
-      transaction <- bla
-      _ <- runTransaction transaction
-      pure ()
-    htmlUi
-
 -- fix
 --   ( \io -> do
 --       logInfo "delay"
@@ -617,8 +617,8 @@ test doSearch =
 --       io
 --   )
 
-bla :: (MonadThrow m, MonadIO m, MonadLogger m, MonadPostgres m) => m (Transaction m ())
-bla = do
+exampleSearch :: (MonadThrow m, MonadIO m, MonadLogger m, MonadPostgres m) => m (Transaction m ())
+exampleSearch = do
   t1 <-
     redactedSearchAndInsert
       [ ("searchstr", "cherish"),