|
|
|
@ -2,7 +2,7 @@ import debug from 'debug';
|
|
|
|
|
import Redis from 'ioredis-mock'; |
|
|
|
|
import CacheMgr from './CacheMgr'; |
|
|
|
|
import type IORedis from 'ioredis'; |
|
|
|
|
import { CacheDelDirection, CacheGetType, CacheScope } from '~/utils/globals'; |
|
|
|
|
import { CacheDelDirection, CacheGetType } from '~/utils/globals'; |
|
|
|
|
const log = debug('nc:cache'); |
|
|
|
|
|
|
|
|
|
export default class RedisMockCacheMgr extends CacheMgr { |
|
|
|
@ -205,13 +205,6 @@ export default class RedisMockCacheMgr extends CacheMgr {
|
|
|
|
|
const propValues = props.map((p) => o[p]); |
|
|
|
|
// e.g. nc:<orgs>:<scope>:<prop_value_1>:<prop_value_2>
|
|
|
|
|
getKey = `${this.prefix}:${scope}:${propValues.join(':')}`; |
|
|
|
|
} else { |
|
|
|
|
// e.g. nc:<orgs>:<scope>:<model_id_1>
|
|
|
|
|
getKey = `${this.prefix}:${scope}:${o.id}`; |
|
|
|
|
// special case - MODEL_ROLE_VISIBILITY
|
|
|
|
|
if (scope === CacheScope.MODEL_ROLE_VISIBILITY) { |
|
|
|
|
getKey = `${this.prefix}:${scope}:${o.fk_view_id}:${o.role}`; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// set Get Key
|
|
|
|
|
log(`RedisMockCacheMgr::setList: setting key ${getKey}`); |
|
|
|
|