Browse Source

refactor: use update method for modifying partial data in cache

pull/8281/head
Pranav C 7 months ago
parent
commit
60da4ab82f
  1. 9
      packages/nocodb/src/models/GalleryViewColumn.ts
  2. 8
      packages/nocodb/src/models/KanbanViewColumn.ts
  3. 8
      packages/nocodb/src/models/MapViewColumn.ts

9
packages/nocodb/src/models/GalleryViewColumn.ts

@ -140,14 +140,7 @@ export default class GalleryViewColumn {
// get existing cache
const key = `${CacheScope.GALLERY_VIEW_COLUMN}:${columnId}`;
let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT);
if (o) {
// update data
o = { ...o, ...updateObj };
// set cache
await NocoCache.set(key, o);
}
await NocoCache.update(key, updateObj);
// on view column update, delete any optimised single query cache
{

8
packages/nocodb/src/models/KanbanViewColumn.ts

@ -132,13 +132,7 @@ export default class KanbanViewColumn implements KanbanColumnType {
// get existing cache
const key = `${CacheScope.KANBAN_VIEW_COLUMN}:${columnId}`;
let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT);
if (o) {
// update data
o = { ...o, ...updateObj };
// set cache
await NocoCache.set(key, o);
}
await NocoCache.update(key, updateObj);
// on view column update, delete any optimised single query cache
{

8
packages/nocodb/src/models/MapViewColumn.ts

@ -129,13 +129,7 @@ export default class MapViewColumn {
// get existing cache
const key = `${CacheScope.MAP_VIEW_COLUMN}:${columnId}`;
let o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT);
if (o) {
// update data
o = { ...o, ...updateObj };
// set cache
await NocoCache.set(key, o);
}
await NocoCache.update(key, updateObj);
// on view column update, delete any optimised single query cache
{

Loading…
Cancel
Save