@azteam/redis-async 1.0.56 → 1.0.59

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": "@azteam/redis-async",
3
- "version": "1.0.56",
3
+ "version": "1.0.59",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "engines": {
@@ -16,7 +16,7 @@
16
16
  "author": "toda <sp.azsolution.net@gmail.com>",
17
17
  "license": "MIT",
18
18
  "dependencies": {
19
- "@azteam/util": "1.0.10",
19
+ "@azteam/util": "1.0.11",
20
20
  "redis": "4.0.6"
21
21
  }
22
22
  }
package/src/RedisAsync.js CHANGED
@@ -2,7 +2,7 @@ import {createClient} from 'redis';
2
2
  import {timeout} from '@azteam/util';
3
3
 
4
4
  class RedisAsync {
5
- constructor(configs = []) {
5
+ constructor(config) {
6
6
  this.connected = false;
7
7
  this.host = config.host;
8
8
  this.port = config.port;
@@ -52,7 +52,7 @@ class RedisAsync {
52
52
  });
53
53
 
54
54
  this.client.on('error', (err) => {
55
- this._alert('error', 'Redis Error' + err);
55
+ this._alert('error', `Redis Error${err}`);
56
56
  });
57
57
  }
58
58
 
@@ -76,8 +76,7 @@ class RedisAsync {
76
76
 
77
77
  async ttl(key) {
78
78
  const prefixKey = this.parsePrefix(key);
79
-
80
- return await this.client.ttl(prefixKey);
79
+ return this.client.ttl(prefixKey);
81
80
  }
82
81
 
83
82
  async expire(key, timeSecond = 86400) {
@@ -123,7 +122,7 @@ class RedisAsync {
123
122
 
124
123
  if (keys.length > 0) {
125
124
  console.log(`Redis REMOVE keys`, keys);
126
- return await this.client.del(keys);
125
+ return this.client.del(keys);
127
126
  }
128
127
  }
129
128
  } else {
@@ -133,6 +132,7 @@ class RedisAsync {
133
132
  }
134
133
  return false;
135
134
  }
135
+ return false;
136
136
  }
137
137
 
138
138
  setAlertCallback(callback) {