@graphql-mesh/cache-redis 0.95.7 → 0.95.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.js +4 -2
- package/esm/index.js +4 -2
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -16,7 +16,9 @@ class RedisCache {
|
|
|
16
16
|
if (!['redis:', 'rediss:'].includes(redisUrl.protocol)) {
|
|
17
17
|
throw new Error('Redis URL must use either redis:// or rediss://');
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
if (lazyConnect) {
|
|
20
|
+
redisUrl.searchParams.set('lazyConnect', 'true');
|
|
21
|
+
}
|
|
20
22
|
redisUrl.searchParams.set('enableAutoPipelining', 'true');
|
|
21
23
|
redisUrl.searchParams.set('enableOfflineQueue', 'true');
|
|
22
24
|
options.logger.debug(`Connecting to Redis at ${redisUrl.toString()}`);
|
|
@@ -32,7 +34,7 @@ class RedisCache {
|
|
|
32
34
|
host: parsedHost,
|
|
33
35
|
port: parseInt(parsedPort),
|
|
34
36
|
password: parsedPassword,
|
|
35
|
-
lazyConnect,
|
|
37
|
+
...(lazyConnect ? { lazyConnect: true } : {}),
|
|
36
38
|
enableAutoPipelining: true,
|
|
37
39
|
enableOfflineQueue: true,
|
|
38
40
|
});
|
package/esm/index.js
CHANGED
|
@@ -13,7 +13,9 @@ export default class RedisCache {
|
|
|
13
13
|
if (!['redis:', 'rediss:'].includes(redisUrl.protocol)) {
|
|
14
14
|
throw new Error('Redis URL must use either redis:// or rediss://');
|
|
15
15
|
}
|
|
16
|
-
|
|
16
|
+
if (lazyConnect) {
|
|
17
|
+
redisUrl.searchParams.set('lazyConnect', 'true');
|
|
18
|
+
}
|
|
17
19
|
redisUrl.searchParams.set('enableAutoPipelining', 'true');
|
|
18
20
|
redisUrl.searchParams.set('enableOfflineQueue', 'true');
|
|
19
21
|
options.logger.debug(`Connecting to Redis at ${redisUrl.toString()}`);
|
|
@@ -29,7 +31,7 @@ export default class RedisCache {
|
|
|
29
31
|
host: parsedHost,
|
|
30
32
|
port: parseInt(parsedPort),
|
|
31
33
|
password: parsedPassword,
|
|
32
|
-
lazyConnect,
|
|
34
|
+
...(lazyConnect ? { lazyConnect: true } : {}),
|
|
33
35
|
enableAutoPipelining: true,
|
|
34
36
|
enableOfflineQueue: true,
|
|
35
37
|
});
|