@powfix/core-js 0.11.3 → 0.11.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.
|
@@ -4,6 +4,7 @@ export declare class RedisClient {
|
|
|
4
4
|
private status;
|
|
5
5
|
readonly client: RedisClientType<RedisDefaultModules & RedisModules, RedisFunctions, RedisScripts>;
|
|
6
6
|
constructor(options?: RedisClient.RedisClientOptions);
|
|
7
|
+
getStatus(): RedisClient.Status;
|
|
7
8
|
start(): Promise<RedisClient.Status>;
|
|
8
9
|
stop(): Promise<RedisClient.Status>;
|
|
9
10
|
private handleOnConnect;
|
|
@@ -27,13 +27,18 @@ class RedisClient {
|
|
|
27
27
|
this.client = (0, redis_1.createClient)({});
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
getStatus() {
|
|
31
|
+
return this.status;
|
|
32
|
+
}
|
|
30
33
|
start() {
|
|
31
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
35
|
console.log(LOG_PREFIX, 'trying to start');
|
|
33
36
|
// register event callback
|
|
34
37
|
this.client.on('connect', this.handleOnConnect);
|
|
35
38
|
this.client.on('error', this.handleOnError);
|
|
39
|
+
console.log('before connect');
|
|
36
40
|
yield this.client.connect();
|
|
41
|
+
console.log('after connect');
|
|
37
42
|
this.status = RedisClient.Status.RUNNING;
|
|
38
43
|
console.log(LOG_PREFIX, 'now started');
|
|
39
44
|
return this.status;
|