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.
- package/dist/index.js +10 -10
- 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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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) {
|