Skip to content

Commit

Permalink
[BUFIX] Use unique cache keys in ReleasesController (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
gilbertsoft authored Jul 21, 2022
1 parent 2a10165 commit e38f068
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Controller/Api/MajorVersion/ReleasesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ReleasesController extends AbstractController
#[Route(path: '/', methods: ['GET'])]
public function getReleasesByMajorVersion(string $version): JsonResponse
{
$json = $this->getCache()->get('release-' . $version, function (ItemInterface $item) use ($version): string {
$json = $this->getCache()->get('releases-' . $version, function (ItemInterface $item) use ($version): string {
$item->tag(['releases', 'release-' . $version]);

$majorVersion = $this->findMajorVersion($version);
Expand Down Expand Up @@ -96,7 +96,7 @@ public function getReleasesByMajorVersion(string $version): JsonResponse
#[Route(path: '/latest', methods: ['GET'])]
public function getLatestReleaseByMajorVersion(string $version): JsonResponse
{
$json = $this->getCache()->get('release-' . $version, function (ItemInterface $item) use ($version): string {
$json = $this->getCache()->get('release-latest-' . $version, function (ItemInterface $item) use ($version): string {
$item->tag(['releases', 'release-' . $version]);

$majorVersion = $this->findMajorVersion($version);
Expand Down Expand Up @@ -134,7 +134,7 @@ public function getLatestSecurityReleaseByMajorVersion(string $version): JsonRes
{
$this->checkMajorVersionFormat($version);

$json = $this->getCache()->get('release-' . $version, function (ItemInterface $item) use ($version): string {
$json = $this->getCache()->get('release-latest-security-' . $version, function (ItemInterface $item) use ($version): string {
$item->tag(['releases', 'release-' . $version]);

$release = $this->findLatestSecurityReleaseByMajorVersion($version);
Expand Down Expand Up @@ -179,7 +179,7 @@ public function getLatestSecurityReleaseByMajorVersion(string $version): JsonRes
#[Route(path: '/latest/content', methods: ['GET'])]
public function getLatestReleaseContentByMajorVersion(string $version): JsonResponse
{
$json = $this->getCache()->get('release-' . $version, function (ItemInterface $item) use ($version): string {
$json = $this->getCache()->get('release-latest-content-' . $version, function (ItemInterface $item) use ($version): string {
$item->tag(['releases', 'release-' . $version]);

$majorVersion = $this->findMajorVersion($version);
Expand Down

0 comments on commit e38f068

Please sign in to comment.