Advertisement
NLinker

Db interpreter part of runProd

Mar 27th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. notifyDslProd _m (DbUpsertSettings uid settings next) = do
  2.   let meth = "DbUpsertSettings: "
  3.   Log.debug $ meth <> show uid <> " " <> show settings
  4.   -- TODO warning: fromJust
  5.   cp <- fromJust <$> asks (^. pool)
  6.   r <- liftIO $ HP.use cp $ upsertSettings uid settings
  7.   Log.debug $ meth <> show r
  8.   next
  9. notifyDslProd _m (DbReadSettings uid next) = do
  10.   let meth = "DbReadSettings: "
  11.   Log.debug $ meth <> show uid
  12.   -- TODO warning: fromJust
  13.   cp <- fromJust <$> asks (^. pool)
  14.   r <- liftIO $ HP.use cp $ readSettings uid
  15.   Log.debug $ meth <> show r
  16.   case r of
  17.     Left _err -> next Nothing
  18.     Right mbs -> next mbs
  19. notifyDslProd _m (DbCreateHistoryEntry ntf next) = do
  20.   let meth = "DbCreateHistoryEntry: "
  21.   Log.debug $ meth <> show ntf
  22.   next
  23. notifyDslProd _m (DbReadHistoryEntries rid ret) = do
  24.   let meth = "DbReadHistoryEntries: "
  25.   Log.debug $ meth <> show rid
  26.   ret []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement