Browse Source

Merge pull request #2359 from nocodb/fix/shared-base-cache

fix: delete project:<uuid> in cache for disable shared base
pull/2377/head
Pranav C 2 years ago committed by GitHub
parent
commit
370247680f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      packages/nocodb/src/lib/models/Project.ts

5
packages/nocodb/src/lib/models/Project.ts

@ -237,6 +237,7 @@ export default class Project implements ProjectType {
let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT);
if (o) {
// update data
// new uuid is generated
if (o.uuid && updateObj.uuid && o.uuid !== updateObj.uuid) {
await NocoCache.del(`${CacheScope.PROJECT}:${o.uuid}`);
await NocoCache.set(
@ -244,6 +245,10 @@ export default class Project implements ProjectType {
projectId
);
}
// disable shared base
if (o.uuid && updateObj.uuid === null) {
await NocoCache.del(`${CacheScope.PROJECT}:${o.uuid}`);
}
if (o.title && updateObj.title && o.title !== updateObj.title) {
await NocoCache.del(`${CacheScope.PROJECT}:${o.title}`);
await NocoCache.set(

Loading…
Cancel
Save