Skip to content

Commit

Permalink
Merge branch 'next-34478/force-cache-invalidation' into 'trunk'
Browse files Browse the repository at this point in the history
NEXT-34478 - Remove force cache invalidation when changing snippets

See merge request shopware/6/product/platform!13391
  • Loading branch information
OliverSkroblin committed Mar 20, 2024
2 parents f95236f + 6f50663 commit 4c47132
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Snippet cache invalidation
issue: NEXT-34478
author: oskroblin Skroblin
author_email: [email protected]
---

# Core
* Changed cache invalidation behavior when changing snippets. Invalidation now acts like all other cache invalidations, when delayed cached is configured.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ private function clearCache(array $snippetSetIds): void

$snippetSetCacheKeys = array_map(fn (string $setId) => 'translation.catalog.' . $setId, $snippetSetIds);

$this->cacheInvalidator->invalidate($snippetSetCacheKeys, true);
$this->cacheInvalidator->invalidate($snippetSetCacheKeys);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function assigned(ThemeAssignedEvent $event): void

$salesChannelId = $event->getSalesChannelId();

$this->cacheInvalidator->invalidate(['translation.catalog.' . $salesChannelId], true);
$this->cacheInvalidator->invalidate(['translation.catalog.' . $salesChannelId]);
}

public function reset(ThemeConfigResetEvent $event): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function testInvalidateWithSnippetEvent(): void
$this->cacheInvalidator->expects(static::once())->method('invalidate')->with([
'translation.catalog.' . $ids->get('snippetSet1'),
'translation.catalog.' . $ids->get('snippetSet2'),
], true);
], false);

$this->translatorCacheInvalidate->invalidate($event);
}
Expand Down Expand Up @@ -129,7 +129,7 @@ public function testInvalidateWithSnippetSetEvent(): void
$this->cacheInvalidator->expects(static::once())->method('invalidate')->with([
'translation.catalog.' . $ids->get('snippetSet1'),
'translation.catalog.' . $ids->get('snippetSet2'),
], true);
], false);

$this->translatorCacheInvalidate->invalidate($event);
}
Expand Down

0 comments on commit 4c47132

Please sign in to comment.