Collect size restrictions from the server
This commit is contained in:
parent
d123460b40
commit
a632e8ff55
2 changed files with 9 additions and 3 deletions
|
@ -94,6 +94,9 @@ data ServerData = ServerData
|
||||||
{ isMaster :: Bool
|
{ isMaster :: Bool
|
||||||
, minWireVersion :: Int
|
, minWireVersion :: Int
|
||||||
, maxWireVersion :: Int
|
, maxWireVersion :: Int
|
||||||
|
, maxMessageSizeBytes :: Int
|
||||||
|
, maxBsonObjectSize :: Int
|
||||||
|
, maxWriteBatchSize :: Int
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | Create new Pipeline over given handle. You should 'close' pipeline when finished, which will also close handle. If pipeline is not closed but eventually garbage collected, it will be closed along with handle.
|
-- | Create new Pipeline over given handle. You should 'close' pipeline when finished, which will also close handle. If pipeline is not closed but eventually garbage collected, it will be closed along with handle.
|
||||||
|
|
|
@ -304,6 +304,9 @@ retrieveServerData = do
|
||||||
{ isMaster = (fromMaybe False $ lookup "ismaster" d)
|
{ isMaster = (fromMaybe False $ lookup "ismaster" d)
|
||||||
, minWireVersion = (fromMaybe 0 $ lookup "minWireVersion" d)
|
, minWireVersion = (fromMaybe 0 $ lookup "minWireVersion" d)
|
||||||
, maxWireVersion = (fromMaybe 0 $ lookup "maxWireVersion" d)
|
, maxWireVersion = (fromMaybe 0 $ lookup "maxWireVersion" d)
|
||||||
|
, maxMessageSizeBytes = (fromMaybe 48000000 $ lookup "maxMessageSizeBytes" d)
|
||||||
|
, maxBsonObjectSize = (fromMaybe (16 * 1024 * 1024) $ lookup "maxBsonObjectSize" d)
|
||||||
|
, maxWriteBatchSize = (fromMaybe 1000 $ lookup "maxWriteBatchSize" d)
|
||||||
}
|
}
|
||||||
return newSd
|
return newSd
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue