@3-/ioredis 0.1.3 → 0.1.4
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/lib.js +10 -19
- package/package.json +1 -1
package/lib.js
CHANGED
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import Redis from "ioredis";
|
|
2
2
|
|
|
3
|
-
export default (
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
throw new Error(
|
|
14
|
-
"ioredis can't connect " + url ? url : JSON.stringify(option),
|
|
15
|
-
);
|
|
16
|
-
}
|
|
17
|
-
return 1e3;
|
|
3
|
+
export default (option) => {
|
|
4
|
+
option = {
|
|
5
|
+
retryStrategy: (times) => {
|
|
6
|
+
if (times > 6) {
|
|
7
|
+
throw new Error("ioredis can't connect " + url ? url : JSON.stringify(option));
|
|
8
|
+
}
|
|
9
|
+
return 1e3;
|
|
10
|
+
},
|
|
11
|
+
enableAutoPipelining: true,
|
|
12
|
+
...(option || {}),
|
|
18
13
|
};
|
|
19
14
|
|
|
20
|
-
if (url) {
|
|
21
|
-
return new Redis(url, option);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
15
|
return new Redis(option);
|
|
25
16
|
};
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@3-/ioredis","version":"0.1.
|
|
1
|
+
{"name":"@3-/ioredis","version":"0.1.4","keywords":[],"description":"","repository":{"type":"git","url":"git+https://atomgit.com/i18n/lib.git"},"homepage":"https://atomgit.com/i18n/lib/tree/dev/ioredis","author":"i18n.site@gmail.com","license":"MulanPSL-2.0","exports":{".":"./lib.js","./*":"./*"},"files":["./*"],"devDependencies":{},"scripts":{},"type":"module","dependencies":{"ioredis":"^5.10.1"}}
|