Browse Source

fix: add list suffix if missing on deep del

pull/7464/head
mertmit 10 months ago
parent
commit
d12a39e243
  1. 1
      packages/nocodb/src/cache/RedisCacheMgr.ts
  2. 1
      packages/nocodb/src/cache/RedisMockCacheMgr.ts

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

@ -261,6 +261,7 @@ export default class RedisCacheMgr extends CacheMgr {
log(`RedisCacheMgr::deepDel: remove key ${key}`); log(`RedisCacheMgr::deepDel: remove key ${key}`);
return await this.del(key); return await this.del(key);
} else if (direction === CacheDelDirection.PARENT_TO_CHILD) { } else if (direction === CacheDelDirection.PARENT_TO_CHILD) {
key = /:list$/.test(key) ? key : `${key}:list`;
// given a list key, delete all the children // given a list key, delete all the children
const listOfChildren = await this.get(key, CacheGetType.TYPE_ARRAY); const listOfChildren = await this.get(key, CacheGetType.TYPE_ARRAY);
// delete each child key // delete each child key

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

@ -259,6 +259,7 @@ export default class RedisMockCacheMgr extends CacheMgr {
log(`RedisMockCacheMgr::deepDel: remove key ${key}`); log(`RedisMockCacheMgr::deepDel: remove key ${key}`);
return await this.del(key); return await this.del(key);
} else if (direction === CacheDelDirection.PARENT_TO_CHILD) { } else if (direction === CacheDelDirection.PARENT_TO_CHILD) {
key = /:list$/.test(key) ? key : `${key}:list`;
// given a list key, delete all the children // given a list key, delete all the children
const listOfChildren = await this.get(key, CacheGetType.TYPE_ARRAY); const listOfChildren = await this.get(key, CacheGetType.TYPE_ARRAY);
// delete each child key // delete each child key

Loading…
Cancel
Save