aboutsummaryrefslogtreecommitdiff
path: root/server/src/Thermoprint/Server.hs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/Thermoprint/Server.hs')
-rw-r--r--server/src/Thermoprint/Server.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/Thermoprint/Server.hs b/server/src/Thermoprint/Server.hs
index 49f3e82..c2a4972 100644
--- a/server/src/Thermoprint/Server.hs
+++ b/server/src/Thermoprint/Server.hs
@@ -89,7 +89,7 @@ import Debug.Trace
89data Config m = Config { dyreError :: Maybe String -- ^ Set by 'Dyre' -- sent to log as an error 89data Config m = Config { dyreError :: Maybe String -- ^ Set by 'Dyre' -- sent to log as an error
90 , warpSettings :: Warp.Settings -- ^ Configure 'Warp's behaviour 90 , warpSettings :: Warp.Settings -- ^ Configure 'Warp's behaviour
91 , printers :: Map API.PrinterId Printer 91 , printers :: Map API.PrinterId Printer
92 , queueManagers :: API.PrinterId -> QMConfig m 92 , queueManagers :: API.PrinterId -> QMConfig
93 } 93 }
94 94
95instance MonadIO m => Default (Config m) where 95instance MonadIO m => Default (Config m) where
@@ -99,7 +99,7 @@ instance MonadIO m => Default (Config m) where
99 , queueManagers = const def 99 , queueManagers = const def
100 } 100 }
101 101
102withPrinters :: MonadResource m => Config m -> [(m PrinterMethod, QMConfig m)] -> m (Config m) 102withPrinters :: MonadResource m => Config m -> [(m PrinterMethod, QMConfig)] -> m (Config m)
103-- ^ Add a list of printers to a 'Config' 103-- ^ Add a list of printers to a 'Config'
104withPrinters cfg = fmap updateCfg . foldlM mapInsert (Map.mapWithKey (\k a -> (a, queueManagers cfg k)) $ printers cfg) 104withPrinters cfg = fmap updateCfg . foldlM mapInsert (Map.mapWithKey (\k a -> (a, queueManagers cfg k)) $ printers cfg)
105 where 105 where
@@ -140,7 +140,7 @@ thermoprintServer dyre io = Dyre.wrapMain $ Dyre.defaultParams
140 gcChan <- liftIO newTChanIO 140 gcChan <- liftIO newTChanIO
141 fork tMgr $ jobGC gcChan 141 fork tMgr $ jobGC gcChan
142 let 142 let
143 runQM' = runQM gcChan . queueManagers 143 runQM' = liftIO . runQM gcChan . queueManagers
144 mapM_ (fork tMgr . uncurry runQM') $ Map.toList printers 144 mapM_ (fork tMgr . uncurry runQM') $ Map.toList printers
145 nChan <- liftIO $ newBroadcastTChanIO 145 nChan <- liftIO $ newBroadcastTChanIO
146 let 146 let