Browse Source

fix: append before getList

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/7234/head
mertmit 9 months ago
parent
commit
ed7701f771
  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