diff options
-rw-r--r-- | bragi/thermoprint-server/thermoprint-server.hs | 8 |
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 | ||
5 | module Main (main) where | 4 | module Main (main) where |
6 | 5 | ||
@@ -21,7 +20,7 @@ import qualified Network.Wai.Handler.Warp as Warp | |||
21 | type ServerM = ReaderT ConnectionPool (LoggingT IO) | 20 | type ServerM = ReaderT ConnectionPool (LoggingT IO) |
22 | 21 | ||
23 | main :: IO () | 22 | main :: IO () |
24 | main = thermoprintServer True (Nat runDb) $ configure (\c -> c{..}) <$> def `withPrinters` printers' | 23 | main = 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 |