Skip to content

Commit 4ded350

Browse files
committed
Add support for the GetRoutingTable message
1 parent d77a6e4 commit 4ded350

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

bolt-connection/src/rediscovery/routing-table.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,21 @@ const MIN_ROUTERS = 1
3737
* The routing table object used to determine the role of the servers in the driver.
3838
*/
3939
export default class RoutingTable {
40-
constructor ({ database, routers, readers, writers, expirationTime } = {}) {
40+
constructor ({
41+
database,
42+
routers,
43+
readers,
44+
writers,
45+
expirationTime,
46+
ttl
47+
} = {}) {
4148
this.database = database
4249
this.databaseName = database || 'default database'
4350
this.routers = routers || []
4451
this.readers = readers || []
4552
this.writers = writers || []
4653
this.expirationTime = expirationTime || int(0)
54+
this.ttl = ttl
4755
}
4856

4957
/**
@@ -139,6 +147,7 @@ export function createValidRoutingTable (
139147
routerAddress,
140148
rawRoutingTable
141149
) {
150+
const ttl = rawRoutingTable.ttl
142151
const expirationTime = calculateExpirationTime(rawRoutingTable, routerAddress)
143152
const { routers, readers, writers } = parseServers(
144153
rawRoutingTable,
@@ -153,7 +162,8 @@ export function createValidRoutingTable (
153162
routers,
154163
readers,
155164
writers,
156-
expirationTime
165+
expirationTime,
166+
ttl
157167
})
158168
}
159169

0 commit comments

Comments
 (0)