From cf6ba7cbff444db49797076b70a639961f29e8ef Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 9 Mar 2017 22:02:46 +0100 Subject: Syntax --- bragi/thermoprint-server/thermoprint-server.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bragi/thermoprint-server') diff --git a/bragi/thermoprint-server/thermoprint-server.hs b/bragi/thermoprint-server/thermoprint-server.hs index 97b37374..7e571021 100644 --- a/bragi/thermoprint-server/thermoprint-server.hs +++ b/bragi/thermoprint-server/thermoprint-server.hs @@ -1,6 +1,5 @@ {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ImpredicativeTypes #-} -{-# LANGUAGE RecordWildCards #-} module Main (main) where @@ -21,7 +20,7 @@ import qualified Network.Wai.Handler.Warp as Warp type ServerM = ReaderT ConnectionPool (LoggingT IO) main :: IO () -main = thermoprintServer True (Nat runDb) $ configure (\c -> c{..}) <$> def `withPrinters` printers' +main = thermoprintServer True (Nat runDb) $ configure <$> def `withPrinters` printers' where runDb :: ServerM a -> IO a runDb = runStderrLoggingT . withPostgresqlPool "" 5 . runReaderT @@ -29,6 +28,11 @@ main = thermoprintServer True (Nat runDb) $ configure (\c -> c{..}) <$> def `wit printers' = [ (pure $ genericPrint "/dev/usb/lp0", def :: QMConfig (ResourceT ServerM)) ] + configure c = c + { queueManagers = queueManagers + , warpSettings = warpSettings + } + queueManagers _ = QMConfig { manager = union [ limitHistorySize 100 , limitHistoryAge 3600 -- cgit v1.2.3