blob: 0425f677ece5ec6de8874149718d88dce8f059eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
module Fig.Frontend.DB where
import Control.Error.Util (hush)
import qualified Database.Redis as Redis
import Fig.Prelude
connect :: MonadIO m => m Redis.Connection
connect = liftIO $ Redis.checkedConnect Redis.defaultConnectInfo
{ Redis.connectHost = "shiro"
}
get :: MonadIO m => Redis.Connection -> ByteString -> m (Maybe ByteString)
get c key = liftIO $ Redis.runRedis c do
v <- Redis.get key
pure $ join $ hush v
|