Skip to content

Commit 8a3dc0c

Browse files
committed
Small fix and sync deno
1 parent 515134d commit 8a3dc0c

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

packages/bolt-connection/src/lang/object.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export function equals (a, b) {
2222
return true
2323
}
2424

25+
if (a === null || b === null) {
26+
return false
27+
}
28+
2529
if (typeof a === 'object' && typeof b === 'object') {
2630
const keysA = Object.keys(a)
2731
const keysB = Object.keys(b)

packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-direct.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const {
3333
const { SERVICE_UNAVAILABLE } = error
3434

3535
export default class DirectConnectionProvider extends PooledConnectionProvider {
36-
constructor ({ id, config, log, address, userAgent, authTokenProvider }) {
37-
super({ id, config, log, userAgent, authTokenProvider })
36+
constructor ({ id, config, log, address, userAgent, authTokenProvider, newPool }) {
37+
super({ id, config, log, userAgent, authTokenProvider, newPool })
3838

3939
this._address = address
4040
}

packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-pooled.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import AuthenticationProvider from './authentication-provider.js'
2525
const { SERVICE_UNAVAILABLE } = error
2626
export default class PooledConnectionProvider extends ConnectionProvider {
2727
constructor (
28-
{ id, config, log, userAgent, authTokenProvider },
28+
{ id, config, log, userAgent, authTokenProvider, newPool = (...args) => new Pool(...args) },
2929
createChannelConnectionHook = null
3030
) {
3131
super()
@@ -44,7 +44,7 @@ export default class PooledConnectionProvider extends ConnectionProvider {
4444
this._log
4545
)
4646
})
47-
this._connectionPool = new Pool({
47+
this._connectionPool = newPool({
4848
create: this._createConnection.bind(this),
4949
destroy: this._destroyConnection.bind(this),
5050
validateOnAcquire: this._validateConnectionOnAcquire.bind(this),
@@ -95,7 +95,7 @@ export default class PooledConnectionProvider extends ConnectionProvider {
9595
await this._authenticationProvider.authenticate({ connection: conn, auth })
9696
return true
9797
} catch (error) {
98-
this._log.info(
98+
this._log.debug(
9999
`The connection ${conn.id} is not valid because of an error ${error.code} '${error.message}'`
100100
)
101101
return false

packages/neo4j-driver-deno/lib/bolt-connection/connection-provider/connection-provider-routing.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ export default class RoutingConnectionProvider extends PooledConnectionProvider
6767
log,
6868
userAgent,
6969
authTokenProvider,
70-
routingTablePurgeDelay
70+
routingTablePurgeDelay,
71+
newPool
7172
}) {
72-
super({ id, config, log, userAgent, authTokenProvider }, address => {
73+
super({ id, config, log, userAgent, authTokenProvider, newPool }, address => {
7374
return createChannelConnection(
7475
address,
7576
this._config,

packages/neo4j-driver-deno/lib/bolt-connection/lang/object.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export function equals (a, b) {
2222
return true
2323
}
2424

25+
if (a === null || b === null) {
26+
return false
27+
}
28+
2529
if (typeof a === 'object' && typeof b === 'object') {
2630
const keysA = Object.keys(a)
2731
const keysB = Object.keys(b)

0 commit comments

Comments
 (0)