fix minor compiler warnings
This commit is contained in:
parent
624890c1a6
commit
3db3cc9999
1 changed files with 2 additions and 2 deletions
|
@ -116,7 +116,7 @@ getReplicaInfo conn = do
|
||||||
_ <- look "ismaster" info
|
_ <- look "ismaster" info
|
||||||
return $ ReplicaInfo (connHost conn) info
|
return $ ReplicaInfo (connHost conn) info
|
||||||
|
|
||||||
data ReplicaInfo = ReplicaInfo {infoHost :: Host, infoDoc :: Document} deriving (Show)
|
data ReplicaInfo = ReplicaInfo {_infoHost :: Host, infoDoc :: Document} deriving (Show)
|
||||||
-- ^ Configuration info of a host in a replica set (result of /ismaster/ command). Contains all the hosts in the replica set plus its role in that set (master, slave, or arbiter)
|
-- ^ Configuration info of a host in a replica set (result of /ismaster/ command). Contains all the hosts in the replica set plus its role in that set (master, slave, or arbiter)
|
||||||
|
|
||||||
{- isPrimary :: ReplicaInfo -> Bool
|
{- isPrimary :: ReplicaInfo -> Bool
|
||||||
|
@ -129,7 +129,7 @@ isSecondary = true1 "secondary" -}
|
||||||
|
|
||||||
primary :: ReplicaInfo -> Maybe Host
|
primary :: ReplicaInfo -> Maybe Host
|
||||||
-- ^ Read primary from configuration info. During failover or minor network partition there is no primary (Nothing).
|
-- ^ Read primary from configuration info. During failover or minor network partition there is no primary (Nothing).
|
||||||
primary (ReplicaInfo host info) = if at "ismaster" info then Just host else readHostPort <$> lookup "primary" info
|
primary (ReplicaInfo host' info) = if at "ismaster" info then Just host' else readHostPort <$> lookup "primary" info
|
||||||
|
|
||||||
replicas :: ReplicaInfo -> [Host]
|
replicas :: ReplicaInfo -> [Host]
|
||||||
-- ^ All replicas in set according to this replica configuration info with primary at head, if there is one.
|
-- ^ All replicas in set according to this replica configuration info with primary at head, if there is one.
|
||||||
|
|
Loading…
Reference in a new issue