Browse Source

fix(nocodb): set none list for all scopes

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

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

@ -163,17 +163,8 @@ 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);
// Set NONE here so that it won't hit the DB on each page load
return this.set(listKey, ['NONE']);
}
// fetch existing list
const listOfGetKeys =

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

@ -162,16 +162,8 @@ 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);
// Set NONE here so that it won't hit the DB on each page load
return this.set(listKey, ['NONE']);
}
// fetch existing list
const listOfGetKeys =

Loading…
Cancel
Save