@toa.io/extensions.stash 0.20.0-dev.20 → 0.20.0-dev.21
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.stash",
|
|
3
|
-
"version": "0.20.0-dev.
|
|
3
|
+
"version": "0.20.0-dev.21",
|
|
4
4
|
"description": "Toa Stash",
|
|
5
5
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/toa-io/toa#readme",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"preset": "ts-jest",
|
|
30
30
|
"testEnvironment": "node"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "7dbe313e05e714e35401adb5f0507e140f3f1215"
|
|
33
33
|
}
|
package/source/Connection.ts
CHANGED
|
@@ -8,11 +8,15 @@ export class Connection extends Connector {
|
|
|
8
8
|
super()
|
|
9
9
|
|
|
10
10
|
const keyPrefix = `${locator.namespace}:${locator.name}:`
|
|
11
|
-
const options: ClusterOptions = { keyPrefix, enableReadyCheck: true }
|
|
11
|
+
const options: ClusterOptions = { keyPrefix, enableReadyCheck: true, lazyConnect: true }
|
|
12
12
|
|
|
13
13
|
this.redis = new Redis(url, options)
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
protected override async open (): Promise<void> {
|
|
17
|
+
await this.redis.connect()
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
protected override async close (): Promise<void> {
|
|
17
21
|
this.redis.disconnect()
|
|
18
22
|
}
|
package/transpiled/Connection.js
CHANGED
|
@@ -8,9 +8,12 @@ class Connection extends core_1.Connector {
|
|
|
8
8
|
constructor(url, locator) {
|
|
9
9
|
super();
|
|
10
10
|
const keyPrefix = `${locator.namespace}:${locator.name}:`;
|
|
11
|
-
const options = { keyPrefix, enableReadyCheck: true };
|
|
11
|
+
const options = { keyPrefix, enableReadyCheck: true, lazyConnect: true };
|
|
12
12
|
this.redis = new ioredis_1.Redis(url, options);
|
|
13
13
|
}
|
|
14
|
+
async open() {
|
|
15
|
+
await this.redis.connect();
|
|
16
|
+
}
|
|
14
17
|
async close() {
|
|
15
18
|
this.redis.disconnect();
|
|
16
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Connection.js","sourceRoot":"","sources":["../source/Connection.ts"],"names":[],"mappings":";;;AAAA,qCAAoD;AACpD,uCAAsD;AAEtD,MAAa,UAAW,SAAQ,gBAAS;IACvB,KAAK,CAAO;IAE5B,YAAoB,GAAW,EAAE,OAAgB;QAC/C,KAAK,EAAE,CAAA;QAEP,MAAM,SAAS,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,GAAG,CAAA;QACzD,MAAM,OAAO,GAAmB,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"Connection.js","sourceRoot":"","sources":["../source/Connection.ts"],"names":[],"mappings":";;;AAAA,qCAAoD;AACpD,uCAAsD;AAEtD,MAAa,UAAW,SAAQ,gBAAS;IACvB,KAAK,CAAO;IAE5B,YAAoB,GAAW,EAAE,OAAgB;QAC/C,KAAK,EAAE,CAAA;QAEP,MAAM,SAAS,GAAG,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,IAAI,GAAG,CAAA;QACzD,MAAM,OAAO,GAAmB,EAAE,SAAS,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAA;QAExF,IAAI,CAAC,KAAK,GAAG,IAAI,eAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IACtC,CAAC;IAEkB,KAAK,CAAC,IAAI;QAC3B,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAA;IAC5B,CAAC;IAEkB,KAAK,CAAC,KAAK;QAC5B,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAA;IACzB,CAAC;CACF;AAnBD,gCAmBC"}
|