Browse Source

fix(nocodb): set none list for all scopes

pull/5430/head
Wing-Kam Wong 1 year ago
parent
commit
4abbf4a123
  1. 9
      packages/nocodb/src/lib/cache/RedisCacheMgr.ts
  2. 10
      packages/nocodb/src/lib/cache/RedisMockCacheMgr.ts

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

@ -163,18 +163,9 @@ 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)
) {
// Set NONE here so that it won't hit the DB on each page load
return this.set(listKey, ['NONE']);
}
return Promise.resolve(true);
}
// fetch existing list
const listOfGetKeys =
(await this.get(listKey, CacheGetType.TYPE_ARRAY)) || [];

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

@ -162,17 +162,9 @@ 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)
) {
// Set NONE here so that it won't hit the DB on each page load
return this.set(listKey, ['NONE']);
}
return Promise.resolve(true);
}
// fetch existing list
const listOfGetKeys =
(await this.get(listKey, CacheGetType.TYPE_ARRAY)) || [];

Loading…
Cancel
Save