vona-module-a-redis 5.0.27 → 5.0.28
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 +5 -5
- package/dist/lib/redis.d.ts +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import { BeanInfo, BeanBase, cast, deepExtend, BeanSimple, combineConfigDefault,
|
|
|
2
2
|
import { Service, Bean, Scope } from 'vona-module-a-bean';
|
|
3
3
|
import { Redis } from 'ioredis';
|
|
4
4
|
|
|
5
|
-
function getRedisClientKeyPrefix(clientName,
|
|
6
|
-
const mode = ['test', 'dev'].includes(
|
|
7
|
-
return `${clientName}_${
|
|
5
|
+
function getRedisClientKeyPrefix(clientName, app) {
|
|
6
|
+
const mode = ['test', 'dev'].includes(app.configMeta.mode) ? '_local' : '';
|
|
7
|
+
return `${clientName}_${app.name}${mode}:`;
|
|
8
8
|
}
|
|
9
|
-
function prepareRedisClientKeyPrefix(keyPrefix, clientName,
|
|
10
|
-
return keyPrefix === true ? getRedisClientKeyPrefix(clientName,
|
|
9
|
+
function prepareRedisClientKeyPrefix(keyPrefix, clientName, app) {
|
|
10
|
+
return keyPrefix === true ? getRedisClientKeyPrefix(clientName, app) : keyPrefix;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
var _dec$3, _dec2$3, _class$3;
|
package/dist/lib/redis.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function getRedisClientKeyPrefix(clientName: string,
|
|
3
|
-
export declare function prepareRedisClientKeyPrefix(keyPrefix: string | true | undefined, clientName: string,
|
|
1
|
+
import type { VonaApplication } from 'vona';
|
|
2
|
+
export declare function getRedisClientKeyPrefix(clientName: string, app: VonaApplication): string;
|
|
3
|
+
export declare function prepareRedisClientKeyPrefix(keyPrefix: string | true | undefined, clientName: string, app: VonaApplication): string | undefined;
|