Skip to content

Commit 23a321a

Browse files
committed
Removed KEEP-ALIVE.
1 parent cca327a commit 23a321a

File tree

5 files changed

+6
-26
lines changed

5 files changed

+6
-26
lines changed

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changes Logs
22

3+
## v0.1.8
4+
5+
- Removed KEEP-ALIVE.
6+
37
## v0.1.7
48

59
- Added keep-alive for clients.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@litert/redis",
3-
"version": "0.1.7",
3+
"version": "0.1.8",
44
"description": "A redis protocol implement for Node.js.",
55
"main": "./dist/index.js",
66
"scripts": {

sources/lib/RedisClient.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ implements Abstract.RedisClient {
3535

3636
private _listeners!: Dict<Array<Abstract.SubscriptionCallback | Readable>>;
3737

38-
private _keepAlive: any;
39-
4038
public constructor(
4139
connection: Net.Socket,
4240
host: string,
@@ -47,14 +45,6 @@ implements Abstract.RedisClient {
4745

4846
super(connection, host, port, createDecoder, createEncoder);
4947

50-
this._keepAlive = setInterval(() => {
51-
52-
if (this._status === Abstract.ClientStatus.NORMAL) {
53-
54-
this.executeNow("PING").catch((e) => this.emit("error", e));
55-
}
56-
}, 5000);
57-
5848
this._database = 0;
5949
}
6050

@@ -1323,8 +1313,6 @@ implements Abstract.RedisClient {
13231313
delete this._subscriber;
13241314
}
13251315

1326-
clearInterval(this._keepAlive);
1327-
13281316
return super.close();
13291317
}
13301318

sources/lib/SubscriberClient.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ implements Abstract.ProtocolClient {
3434

3535
protected _password: string;
3636

37-
private _keepAlive: any;
38-
3937
public constructor(
4038
connection: Net.Socket,
4139
host: string,
@@ -46,14 +44,6 @@ implements Abstract.ProtocolClient {
4644
) {
4745
super(connection, host, port, createDecoder, createEncoder);
4846

49-
this._keepAlive = setInterval(() => {
50-
51-
if (this._status === Abstract.ClientStatus.NORMAL) {
52-
53-
this.executeNow("PING").catch((e) => this.emit("error", e));
54-
}
55-
}, 5000);
56-
5747
this._subjects = [];
5848
this._patterns = [];
5949
this._password = password;
@@ -329,8 +319,6 @@ implements Abstract.ProtocolClient {
329319

330320
public async close(): Promise<void> {
331321

332-
clearInterval(this._keepAlive);
333-
334322
return super.close();
335323
}
336324
}

0 commit comments

Comments
 (0)