Skip to content

Commit

Permalink
update with actual replication
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners-nr committed Aug 12, 2024
1 parent 585f61b commit 5a014ab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/instrumentation/@node-redis/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function getRedisParams(clientOpts) {
// see: https://github.com/redis/node-redis/blob/5576a0db492cda2cd88e09881bc330aa956dd0f5/packages/client/lib/client/index.ts#L160
if (clientOpts?.url) {
const parsedURL = new URL(clientOpts.url)
clientOpts.socket = { host: parsedURL.hostname }
clientOpts.socket = Object.assign({}, clientOpts.socket, { host: parsedURL.hostname })
if (parsedURL.port) {
clientOpts.socket.port = parsedURL.port
}
Expand Down
2 changes: 2 additions & 0 deletions test/lib/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ module.exports = {

redis_host: process.env.NR_NODE_TEST_REDIS_HOST || 'localhost',
redis_port: process.env.NR_NODE_TEST_REDIS_PORT || 6379,
redis_tls_host: process.env.NR_NODE_TEST_REDIS_TLS_HOST || '127.0.0.1',
redis_tls_port: process.env.NR_NODE_TEST_REDIS_TLS_PORT || 6380,

cassandra_host: process.env.NR_NODE_TEST_CASSANDRA_HOST || 'localhost',
cassandra_port: process.env.NR_NODE_TEST_CASSANDRA_PORT || 9042,
Expand Down
4 changes: 2 additions & 2 deletions test/versioned/redis/tls.tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

const tap = require('tap')
const helper = require('../../lib/agent_helper')
const { redis_tls_host: HOST, redis_tls_port: PORT } = require('../../lib/params')
const { removeModules } = require('../../lib/cache-buster')

tap.test('redis over tls connection', (t) => {
Expand All @@ -15,9 +16,8 @@ tap.test('redis over tls connection', (t) => {
t.redis = require('redis')
t.client = await t.redis
.createClient({
url: `rediss://${HOST}:${PORT}`,
socket: {
port: 6380,
host: '127.0.0.1',
tls: true,
rejectUnauthorized: false
}
Expand Down

0 comments on commit 5a014ab

Please sign in to comment.