vona-module-a-redis 5.0.26 → 5.0.27

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -71,16 +71,16 @@ let ServiceRedis = (_dec$1 = Service(), _dec2$1 = BeanInfo({
71
71
  await this._clearRedisKeys(app.bean.redis.get('queue'), `${getRedisClientKeyPrefix('bull', app)}*`);
72
72
  // broadcast channel has subscribed
73
73
  // await _clearRedisKeys(app.redis.get('broadcast'), `${getRedisClientKeyPrefix('broadcast', app)}*`);
74
- // redlock
75
- for (const clientName of this.$scope.redlock.config.redlock.clients) {
76
- await this._clearRedisKeys(app.bean.redis.get(clientName), `${getRedisClientKeyPrefix('redlock', app)}*`);
77
- }
78
- for (const clientName in app.config.redis.clients) {
79
- if (['redlock', 'limiter', 'queue', 'broadcast'].includes(clientName)) continue;
80
- if (clientName.includes('redlock')) continue;
81
- const client = app.config.redis.clients[clientName];
82
- const keyPrefix = prepareRedisClientKeyPrefix(client.keyPrefix, clientName, this.app);
83
- await this._clearRedisKeys(app.bean.redis.get(clientName), `${keyPrefix}*`);
74
+ for (const _clientName in app.config.redis.clients) {
75
+ const clientName = _clientName;
76
+ if (['limiter', 'queue', 'broadcast'].includes(clientName)) continue;
77
+ if (clientName.startsWith('redlock')) {
78
+ await this._clearRedisKeys(app.bean.redis.get(clientName), `${getRedisClientKeyPrefix('redlock', app)}*`);
79
+ } else {
80
+ const client = app.config.redis.clients[clientName];
81
+ const keyPrefix = prepareRedisClientKeyPrefix(client.keyPrefix, clientName, this.app);
82
+ await this._clearRedisKeys(app.bean.redis.get(clientName), `${keyPrefix}*`);
83
+ }
84
84
  }
85
85
  }
86
86
  async _clearRedisKeys(redis, pattern) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-module-a-redis",
3
3
  "type": "module",
4
- "version": "5.0.26",
4
+ "version": "5.0.27",
5
5
  "title": "a-redis",
6
6
  "vonaModule": {
7
7
  "dependencies": {},