Browse Source

Merge pull request #7234 from nocodb/fix/append-cache

fix: append before getList
pull/7216/head
mertmit 9 months ago committed by GitHub
parent
commit
738e166184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      packages/nocodb/src/cache/RedisCacheMgr.ts
  2. 9
      packages/nocodb/src/cache/RedisMockCacheMgr.ts

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

@ -276,8 +276,13 @@ export default class RedisCacheMgr extends CacheMgr {
? `${this.prefix}:${scope}:list`
: `${this.prefix}:${scope}:${subListKeys.join(':')}:list`;
log(`RedisCacheMgr::appendToList: append key ${key} to ${listKey}`);
let list = (await this.get(listKey, CacheGetType.TYPE_ARRAY)) || [];
if (list.length && list.includes('NONE')) {
let list = await this.get(listKey, CacheGetType.TYPE_ARRAY);
if (!list || !list.length) {
return false;
}
if (list.includes('NONE')) {
list = [];
await this.del(listKey);
}

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

@ -276,8 +276,13 @@ export default class RedisMockCacheMgr extends CacheMgr {
? `${this.prefix}:${scope}:list`
: `${this.prefix}:${scope}:${subListKeys.join(':')}:list`;
log(`RedisMockCacheMgr::appendToList: append key ${key} to ${listKey}`);
let list = (await this.get(listKey, CacheGetType.TYPE_ARRAY)) || [];
if (list.length && list[0] === 'NONE') {
let list = await this.get(listKey, CacheGetType.TYPE_ARRAY);
if (!list || !list.length) {
return false;
}
if (list[0] === 'NONE') {
list = [];
await this.del(listKey);
}

Loading…
Cancel
Save