1
1
mirror of https://github.com/aelve/guide.git synced 2024-12-29 00:24:01 +03:00

Fix warnings

This commit is contained in:
Vladislav Sabanov 2018-10-17 23:11:01 +05:00
parent 1b2b16f496
commit ec030f58b3
2 changed files with 7 additions and 7 deletions

View File

@ -371,7 +371,7 @@ adminMethods :: AdminM ctx ()
adminMethods = do adminMethods = do
-- Accept an edit -- Accept an edit
Spock.post (adminRoute <//> "edit" <//> var <//> "accept") $ \n -> do Spock.post (adminRoute <//> "edit" <//> var <//> "accept") $ \n -> do
dbUpdate (RemovePendingEdit n) _ <- dbUpdate (RemovePendingEdit n)
return () return ()
-- Undo an edit -- Undo an edit
Spock.post (adminRoute <//> "edit" <//> var <//> "undo") $ \n -> do Spock.post (adminRoute <//> "edit" <//> var <//> "undo") $ \n -> do
@ -380,7 +380,7 @@ adminMethods = do
case res of case res of
Left err -> Spock.text (toText err) Left err -> Spock.text (toText err)
Right () -> do invalidateCacheForEdit edit Right () -> do invalidateCacheForEdit edit
dbUpdate (RemovePendingEdit n) _ <- dbUpdate (RemovePendingEdit n)
Spock.text "" Spock.text ""
-- Accept a range of edits -- Accept a range of edits
Spock.post (adminRoute <//> "edits" <//> var <//> var <//> "accept") $ \m n -> do Spock.post (adminRoute <//> "edits" <//> var <//> var <//> "accept") $ \m n -> do
@ -394,7 +394,7 @@ adminMethods = do
case res of case res of
Left err -> return (Just ((edit, details), Just err)) Left err -> return (Just ((edit, details), Just err))
Right () -> do invalidateCacheForEdit edit Right () -> do invalidateCacheForEdit edit
dbUpdate (RemovePendingEdit (editId details)) _ <- dbUpdate (RemovePendingEdit (editId details))
return Nothing return Nothing
case failed of case failed of
[] -> Spock.text "" [] -> Spock.text ""

View File

@ -186,7 +186,7 @@ mainWith config = do
hSetBuffering stdout NoBuffering hSetBuffering stdout NoBuffering
-- Create a checkpoint every six hours. Note: if nothing was changed, the -- Create a checkpoint every six hours. Note: if nothing was changed, the
-- checkpoint won't be created, which saves us some space. -- checkpoint won't be created, which saves us some space.
Slave.fork $ forever $ do _ <- Slave.fork $ forever $ do
createCheckpoint' db createCheckpoint' db
threadDelay (1000000 * 3600 * 6) threadDelay (1000000 * 3600 * 6)
-- EKG metrics -- EKG metrics
@ -197,7 +197,7 @@ mainWith config = do
waiMetrics <- EKG.registerWaiMetrics (EKG.serverMetricStore ekg) waiMetrics <- EKG.registerWaiMetrics (EKG.serverMetricStore ekg)
categoryGauge <- EKG.getGauge "db.categories" ekg categoryGauge <- EKG.getGauge "db.categories" ekg
itemGauge <- EKG.getGauge "db.items" ekg itemGauge <- EKG.getGauge "db.items" ekg
Slave.fork $ forever $ do _ <- Slave.fork $ forever $ do
globalState <- Acid.query db GetGlobalState globalState <- Acid.query db GetGlobalState
let allCategories = globalState^.categories let allCategories = globalState^.categories
let allItems = allCategories^..each.items.each let allItems = allCategories^..each.items.each
@ -205,7 +205,7 @@ mainWith config = do
EKG.Gauge.set itemGauge (fromIntegral (length allItems)) EKG.Gauge.set itemGauge (fromIntegral (length allItems))
threadDelay (1000000 * 60) threadDelay (1000000 * 60)
-- Run the API -- Run the API
Slave.fork $ runApiServer db _ <- Slave.fork $ runApiServer db
-- Run the server -- Run the server
let serverState = ServerState { let serverState = ServerState {
_config = config, _config = config,
@ -418,7 +418,7 @@ authRedirect path action = do
startTemplateWatcher :: IO () startTemplateWatcher :: IO ()
startTemplateWatcher = void $ startTemplateWatcher = void $
Slave.fork $ FSNotify.withManager $ \mgr -> do Slave.fork $ FSNotify.withManager $ \mgr -> do
FSNotify.watchTree mgr "templates/" (const True) $ \_ -> _ <- FSNotify.watchTree mgr "templates/" (const True) $ \_ ->
emptyCache emptyCache
forever $ threadDelay 1000000 forever $ threadDelay 1000000