Browse Source

Merge pull request #7747 from nocodb/nc-fix/cache-deep

fix: wrong usage of deepDel
pull/7752/head
Raju Udava 10 months ago committed by GitHub
parent
commit
c8a11d478a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 14
      packages/nocodb/src/models/CalendarView.ts

14
packages/nocodb/src/models/CalendarView.ts

@ -5,12 +5,7 @@ import { extractProps } from '~/helpers/extractProps';
import { prepareForDb, prepareForResponse } from '~/utils/modelUtils';
import NocoCache from '~/cache/NocoCache';
import Noco from '~/Noco';
import {
CacheDelDirection,
CacheGetType,
CacheScope,
MetaTable,
} from '~/utils/globals';
import { CacheGetType, CacheScope, MetaTable } from '~/utils/globals';
import CalendarRange from '~/models/CalendarRange';
export default class CalendarView implements CalendarType {
@ -94,11 +89,6 @@ export default class CalendarView implements CalendarType {
const updateObj = extractProps(body, ['fk_cover_image_col_id', 'meta']);
if (body.calendar_range) {
// if calendar range is updated, delete cache
await NocoCache.deepDel(
`${CacheScope.CALENDAR_VIEW}:${calendarId}`,
CacheDelDirection.CHILD_TO_PARENT,
);
await ncMeta.metaDelete(
null,
null,
@ -108,6 +98,8 @@ export default class CalendarView implements CalendarType {
fk_view_id: calendarId,
},
);
// if calendar range is updated, delete cache
await NocoCache.del(`${CacheScope.CALENDAR_VIEW}:${calendarId}`);
await CalendarRange.bulkInsert(
body.calendar_range.map((range) => {
return {

Loading…
Cancel
Save