@graphql-mesh/cache-redis 0.95.6 → 0.95.7-alpha-20230914105949-36d960af9
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 +5 -4
- package/esm/index.js +5 -4
- package/package.json +3 -3
package/cjs/index.js
CHANGED
|
@@ -10,14 +10,15 @@ function interpolateStrWithEnv(str) {
|
|
|
10
10
|
}
|
|
11
11
|
class RedisCache {
|
|
12
12
|
constructor(options) {
|
|
13
|
+
const lazyConnect = options.lazyConnect !== false;
|
|
13
14
|
if (options.url) {
|
|
14
15
|
const redisUrl = new URL(interpolateStrWithEnv(options.url));
|
|
15
|
-
redisUrl.searchParams.set('lazyConnect', 'true');
|
|
16
|
-
redisUrl.searchParams.set('enableAutoPipelining', 'true');
|
|
17
|
-
redisUrl.searchParams.set('enableOfflineQueue', 'true');
|
|
18
16
|
if (!['redis:', 'rediss:'].includes(redisUrl.protocol)) {
|
|
19
17
|
throw new Error('Redis URL must use either redis:// or rediss://');
|
|
20
18
|
}
|
|
19
|
+
redisUrl.searchParams.set('lazyConnect', lazyConnect.toString());
|
|
20
|
+
redisUrl.searchParams.set('enableAutoPipelining', 'true');
|
|
21
|
+
redisUrl.searchParams.set('enableOfflineQueue', 'true');
|
|
21
22
|
options.logger.debug(`Connecting to Redis at ${redisUrl.toString()}`);
|
|
22
23
|
this.client = new ioredis_1.default(redisUrl?.toString());
|
|
23
24
|
}
|
|
@@ -31,7 +32,7 @@ class RedisCache {
|
|
|
31
32
|
host: parsedHost,
|
|
32
33
|
port: parseInt(parsedPort),
|
|
33
34
|
password: parsedPassword,
|
|
34
|
-
lazyConnect
|
|
35
|
+
lazyConnect,
|
|
35
36
|
enableAutoPipelining: true,
|
|
36
37
|
enableOfflineQueue: true,
|
|
37
38
|
});
|
package/esm/index.js
CHANGED
|
@@ -7,14 +7,15 @@ function interpolateStrWithEnv(str) {
|
|
|
7
7
|
}
|
|
8
8
|
export default class RedisCache {
|
|
9
9
|
constructor(options) {
|
|
10
|
+
const lazyConnect = options.lazyConnect !== false;
|
|
10
11
|
if (options.url) {
|
|
11
12
|
const redisUrl = new URL(interpolateStrWithEnv(options.url));
|
|
12
|
-
redisUrl.searchParams.set('lazyConnect', 'true');
|
|
13
|
-
redisUrl.searchParams.set('enableAutoPipelining', 'true');
|
|
14
|
-
redisUrl.searchParams.set('enableOfflineQueue', 'true');
|
|
15
13
|
if (!['redis:', 'rediss:'].includes(redisUrl.protocol)) {
|
|
16
14
|
throw new Error('Redis URL must use either redis:// or rediss://');
|
|
17
15
|
}
|
|
16
|
+
redisUrl.searchParams.set('lazyConnect', lazyConnect.toString());
|
|
17
|
+
redisUrl.searchParams.set('enableAutoPipelining', 'true');
|
|
18
|
+
redisUrl.searchParams.set('enableOfflineQueue', 'true');
|
|
18
19
|
options.logger.debug(`Connecting to Redis at ${redisUrl.toString()}`);
|
|
19
20
|
this.client = new Redis(redisUrl?.toString());
|
|
20
21
|
}
|
|
@@ -28,7 +29,7 @@ export default class RedisCache {
|
|
|
28
29
|
host: parsedHost,
|
|
29
30
|
port: parseInt(parsedPort),
|
|
30
31
|
password: parsedPassword,
|
|
31
|
-
lazyConnect
|
|
32
|
+
lazyConnect,
|
|
32
33
|
enableAutoPipelining: true,
|
|
33
34
|
enableOfflineQueue: true,
|
|
34
35
|
});
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/cache-redis",
|
|
3
|
-
"version": "0.95.
|
|
3
|
+
"version": "0.95.7-alpha-20230914105949-36d960af9",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@graphql-mesh/cross-helpers": "^0.4.0",
|
|
7
|
-
"@graphql-mesh/types": "
|
|
8
|
-
"@graphql-mesh/utils": "
|
|
7
|
+
"@graphql-mesh/types": "0.95.4-alpha-20230914105949-36d960af9",
|
|
8
|
+
"@graphql-mesh/utils": "0.95.4-alpha-20230914105949-36d960af9",
|
|
9
9
|
"graphql": "*",
|
|
10
10
|
"tslib": "^2.4.0"
|
|
11
11
|
},
|