Skip to content

Commit

Permalink
[backend] fix condition
Browse files Browse the repository at this point in the history
  • Loading branch information
SouadHadjiat committed Feb 5, 2025
1 parent d6e9098 commit 8efbfbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opencti-platform/opencti-graphql/src/database/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const partialRefreshCacheForEntity = async (instance: StoreEntity | Store
logApp.debug('Partial refresh cache for entity', { type: instance.entity_type, id: instance.id });
const instanceToStore = await instanceCache.refresh(instance.id);
const cacheWithoutInstance = instanceCache.values.filter((v: any) => v.id !== instanceToStore.id);
if (cacheWithoutInstance) {
if (instanceToStore) {
instanceCache.values = [...cacheWithoutInstance, instanceToStore];
} else { // instance not found (deleted)
instanceCache.values = [...cacheWithoutInstance];
Expand Down

0 comments on commit 8efbfbb

Please sign in to comment.