Skip to content

Commit 0d1a0e1

Browse files
authored
Merge pull request #11 from Flowpack/move-config-epoch-set-to-switch-step
BUGFIX: move set of config epoch to switch step
2 parents 9718193 + 3c52232 commit 0d1a0e1

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

Classes/Controller/BackendController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function indexAction(?string $contentStore = null)
9898
$currentConfigEpoch = $this->configEpochSettings['current'] ?? null;
9999
$previousConfigEpoch = $this->configEpochSettings['previous'] ?? null;
100100
$configEpochRedis = $redis->get('contentStore:configEpoch');
101-
$showToggleConfigEpochButton = $previousConfigEpoch !== null && !$contentStore->isPrimary();
101+
$showToggleConfigEpochButton = $previousConfigEpoch !== null;
102102

103103
$this->view->assign('contentStore', $contentStore->getIdentifier());
104104
$this->view->assign('overviewData', $this->backendUiDataService->loadBackendOverviewData($contentStore));

Classes/ReleaseSwitch/Infrastructure/RedisReleaseSwitchService.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ class RedisReleaseSwitchService
4141
*/
4242
protected $redisKeyPostfixesForEachReleaseConfiguration;
4343

44+
/**
45+
* @Flow\InjectConfiguration("configEpoch")
46+
* @var array
47+
*/
48+
protected $configEpochSettings;
49+
4450
public function switchContentRelease(RedisInstanceIdentifier $redisInstanceIdentifier, ContentReleaseIdentifier $contentReleaseIdentifier, ContentReleaseLogger $contentReleaseLogger)
4551
{
4652
$redis = $this->redisClient->getRedis($redisInstanceIdentifier);
@@ -71,6 +77,7 @@ public function switchContentRelease(RedisInstanceIdentifier $redisInstanceIdent
7177
}
7278

7379
$redis->set('contentStore:current', $contentReleaseIdentifier->getIdentifier());
80+
$redis->set('contentStore:configEpoch', $this->configEpochSettings['current']);
7481
$releaseMetadata = $this->redisContentReleaseService->fetchMetadataForContentRelease($contentReleaseIdentifier);
7582
$this->redisContentReleaseService->setContentReleaseMetadata($contentReleaseIdentifier, $releaseMetadata->withSwitchTime(new \DateTimeImmutable()), $redisInstanceIdentifier);
7683

Classes/Transfer/ContentReleaseSynchronizer.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ class ContentReleaseSynchronizer
2828
*/
2929
protected $redisKeyPostfixesForEachReleaseConfiguration;
3030

31-
/**
32-
* @Flow\InjectConfiguration("configEpoch")
33-
* @var array
34-
*/
35-
protected $configEpochSettings;
36-
3731
/**
3832
* @Flow\Inject
3933
* @var RedisKeyService
@@ -70,7 +64,6 @@ public function syncToTarget(RedisInstanceIdentifier $targetRedisIdentifier, Con
7064
}
7165

7266
$targetRedis->zAdd('contentStore:registeredReleases', 0, $contentReleaseIdentifier->getIdentifier());
73-
$targetRedis->set('contentStore:configEpoch', $this->configEpochSettings['current']);
7467
}
7568

7669
/**

0 commit comments

Comments
 (0)