From 6e17cd768bb5a502a6ce36085868f7798a0792e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Thu, 10 Aug 2023 16:33:26 +0200 Subject: [PATCH] Update loadtest.js example with new Client constructor --- examples/loadtest.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/loadtest.js b/examples/loadtest.js index b0c7b22..33562d2 100644 --- a/examples/loadtest.js +++ b/examples/loadtest.js @@ -21,11 +21,11 @@ export const options = { }, }; -// Instantiate a new redis client -const redisClient = new redis.Client({ - addrs: __ENV.REDIS_ADDRS.split(",") || new Array("localhost:6379"), // in the form of "host:port", separated by commas - password: __ENV.REDIS_PASSWORD || "", -}); +// Instantiate a new Redis client using a URL +const redisClient = new redis.Client( + // URL in the form of redis[s]://[[username][:password]@][host][:port][/db-number + __ENV.REDIS_URL || "redis://localhost:6379", +); // Prepare an array of crocodile ids for later use // in the context of the measureUsingRedisData function.