Browse Source

fix(nocodb): only set none list for FILTER_EXP, SORT, and MODEL_ROLE_VISIBILITY

pull/5430/head
Wing-Kam Wong 2 years ago
parent
commit
b424f22dda
  1. 9
      packages/nocodb/src/lib/cache/RedisCacheMgr.ts
  2. 9
      packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts

9
packages/nocodb/src/lib/cache/RedisCacheMgr.ts vendored

@ -158,8 +158,17 @@ export default class RedisCacheMgr extends CacheMgr {
? `${this.prefix}:${scope}:list`
: `${this.prefix}:${scope}:${subListKeys.join(':')}:list`;
if (!list.length) {
if (
[
CacheScope.FILTER_EXP,
CacheScope.SORT,
CacheScope.MODEL_ROLE_VISIBILITY,
].includes(scope as CacheScope)
) {
return this.set(listKey, ['NONE']);
}
return Promise.resolve(true);
}
// fetch existing list
const listOfGetKeys =
(await this.get(listKey, CacheGetType.TYPE_ARRAY)) || [];

9
packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts vendored

@ -158,8 +158,17 @@ export default class RedisMockCacheMgr extends CacheMgr {
? `${this.prefix}:${scope}:list`
: `${this.prefix}:${scope}:${subListKeys.join(':')}:list`;
if (!list.length) {
if (
[
CacheScope.FILTER_EXP,
CacheScope.SORT,
CacheScope.MODEL_ROLE_VISIBILITY,
].includes(scope as CacheScope)
) {
return this.set(listKey, ['NONE']);
}
return Promise.resolve(true);
}
// fetch existing list
const listOfGetKeys =
(await this.get(listKey, CacheGetType.TYPE_ARRAY)) || [];

Loading…
Cancel
Save