summaryrefslogtreecommitdiff
path: root/bragi/thermoprint-server/thermoprint-server.hs
diff options
context:
space:
mode:
Diffstat (limited to 'bragi/thermoprint-server/thermoprint-server.hs')
-rw-r--r--bragi/thermoprint-server/thermoprint-server.hs8
1 files changed, 6 insertions, 2 deletions
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 @@
1{-# LANGUAGE OverloadedStrings #-} 1{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE ImpredicativeTypes #-} 2{-# LANGUAGE ImpredicativeTypes #-}
3{-# LANGUAGE RecordWildCards #-}
4 3
5module Main (main) where 4module Main (main) where
6 5
@@ -21,7 +20,7 @@ import qualified Network.Wai.Handler.Warp as Warp
21type ServerM = ReaderT ConnectionPool (LoggingT IO) 20type ServerM = ReaderT ConnectionPool (LoggingT IO)
22 21
23main :: IO () 22main :: IO ()
24main = thermoprintServer True (Nat runDb) $ configure (\c -> c{..}) <$> def `withPrinters` printers' 23main = thermoprintServer True (Nat runDb) $ configure <$> def `withPrinters` printers'
25 where 24 where
26 runDb :: ServerM a -> IO a 25 runDb :: ServerM a -> IO a
27 runDb = runStderrLoggingT . withPostgresqlPool "" 5 . runReaderT 26 runDb = runStderrLoggingT . withPostgresqlPool "" 5 . runReaderT
@@ -29,6 +28,11 @@ main = thermoprintServer True (Nat runDb) $ configure (\c -> c{..}) <$> def `wit
29 printers' = [ (pure $ genericPrint "/dev/usb/lp0", def :: QMConfig (ResourceT ServerM)) 28 printers' = [ (pure $ genericPrint "/dev/usb/lp0", def :: QMConfig (ResourceT ServerM))
30 ] 29 ]
31 30
31 configure c = c
32 { queueManagers = queueManagers
33 , warpSettings = warpSettings
34 }
35
32 queueManagers _ = QMConfig 36 queueManagers _ = QMConfig
33 { manager = union [ limitHistorySize 100 37 { manager = union [ limitHistorySize 100
34 , limitHistoryAge 3600 38 , limitHistoryAge 3600