summaryrefslogtreecommitdiff
path: root/bragi
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-03-09 22:02:46 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2017-03-09 22:02:46 +0100
commitcf6ba7cbff444db49797076b70a639961f29e8ef (patch)
treeeb65ccc902fb0e443bf194870d628c99d430e7d3 /bragi
parent03025c105e5fb3055e57e2df9d2af258d579ff7f (diff)
downloadnixos-cf6ba7cbff444db49797076b70a639961f29e8ef.tar
nixos-cf6ba7cbff444db49797076b70a639961f29e8ef.tar.gz
nixos-cf6ba7cbff444db49797076b70a639961f29e8ef.tar.bz2
nixos-cf6ba7cbff444db49797076b70a639961f29e8ef.tar.xz
nixos-cf6ba7cbff444db49797076b70a639961f29e8ef.zip
Syntax
Diffstat (limited to 'bragi')
-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