about summary refs log tree commit diff
path: root/users/Profpatsch
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2023-09-17T17·27+0200
committerclbot <clbot@tvl.fyi>2023-09-17T18·05+0000
commit07b0dff2099badc7dd7bc231175753e1556b8616 (patch)
tree580c84d527c88db3e019a52ebdd0965886d34542 /users/Profpatsch
parent4ac6423b26170668f99ef2351091d5e1352b298a (diff)
refactor(users/Profpatsch/whatcd-resolver): rename main function r/6604
Change-Id: I8ce8ef1cc8a35358d20610be7c8bdadefd3aa30f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9354
Autosubmit: Profpatsch <mail@profpatsch.de>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/Profpatsch')
-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"),