summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorstuebinm2022-10-11 13:39:16 +0200
committerstuebinm2022-10-11 13:39:16 +0200
commit4caded904c54d1cd85bf54239517e93650a404f5 (patch)
treece150d3588aa766c12ee6bb3e3ed3aea73615d43 /server
parente4b0ae395f3207f4bbaebbf42a3d3a28a516489d (diff)
use template haskell aeson, not generics
this has been bothering me for MONTHS, and it compiles faster now. also fixed some warnings
Diffstat (limited to 'server')
-rw-r--r--server/HtmlOrphans.hs8
-rw-r--r--server/Server.hs6
-rw-r--r--server/Worker.hs3
3 files changed, 8 insertions, 9 deletions
diff --git a/server/HtmlOrphans.hs b/server/HtmlOrphans.hs
index bf06d4c..594d55f 100644
--- a/server/HtmlOrphans.hs
+++ b/server/HtmlOrphans.hs
@@ -26,7 +26,7 @@ import Handlers (AdminOverview (..))
import Lucid (HtmlT, ToHtml)
import Lucid.Base (ToHtml (toHtml))
import Lucid.Html5 (a_, body_, button_, class_, code_, disabled_,
- div_, em_, h1_, h2_, h3_, h4_, h5_, head_,
+ div_, em_, h1_, h2_, h3_, h4_, head_,
href_, html_, id_, li_, link_, main_,
onclick_, p_, rel_, script_, span_, src_,
title_, type_, ul_)
@@ -114,9 +114,9 @@ instance ToHtml AdminOverview where
if null jobs then em_ "(nothing yet)"
else flip M.foldMapWithKey jobs $ \sha1 (ref, status, _lastvalid) -> li_ $ do
case status of
- Pending _ -> badge Info "pending"
- (Linted res rev _) -> toHtml $ maximumLintLevel res
- (Failed _) -> badge Error "system error"
+ Pending _ -> badge Info "pending"
+ (Linted res _ _) -> toHtml $ maximumLintLevel res
+ (Failed _) -> badge Error "system error"
" "; a_ [href_ ("/status/"+|orgSlug org|+"/"+|prettySha sha1|+"/")] $ do
mono $ toHtml $ reporef ref; " on "; mono $ toHtml $ repourl ref
diff --git a/server/Server.hs b/server/Server.hs
index 2c16834..84b4ae8 100644
--- a/server/Server.hs
+++ b/server/Server.hs
@@ -219,9 +219,9 @@ data JobStatus
instance TS.Show JobStatus where
show = \case
- Pending _ -> "Pending"
- Linted res rev _ -> "Linted result"
- Failed err -> "Failed with: " <> show err
+ Pending _ -> "Pending"
+ Linted _ _ _ -> "Linted result"
+ Failed err -> "Failed with: " <> show err
-- | the server's global state; might eventually end up with more
-- stuff in here, hence the newtype
diff --git a/server/Worker.hs b/server/Worker.hs
index d85c44f..ba0fb41 100644
--- a/server/Worker.hs
+++ b/server/Worker.hs
@@ -16,14 +16,13 @@ import CheckDir (recursiveCheckDir,
import Control.Concurrent.Async (async, link)
import Control.Concurrent.STM (writeTChan)
import Control.Concurrent.STM.TQueue
-import Control.Exception (IOException, handle, throw)
+import Control.Exception (IOException, handle)
import Control.Monad.Logger (logError, logErrorN, logInfoN,
runStdoutLoggingT)
import qualified Data.Text as T
import qualified Data.UUID as UUID
import qualified Data.UUID.V4 as UUID
import Fmt ((+|), (|+))
-import GHC.IO.Exception (ioException)
import LintConfig (stuffConfig)
import Server (Config, JobStatus (..),
Org (..),