Skip to content

Commit

Permalink
Merge pull request #14 from Flowpack/switch-config-epoch-to-integer
Browse files Browse the repository at this point in the history
TASK: switch config epoch default value to string with integer content
  • Loading branch information
batabana authored Sep 21, 2022
2 parents c57cc47 + 4254e45 commit c8b0d2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Configuration/Settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Flowpack:

# can be used on the consuming site to ensure non-breaking deployments for changes in the config
configEpoch:
current: v1
current: '1'
previous: ~


Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,16 @@ Example:
Flowpack:
DecoupledContentStore:
configEpoch:
current: v2
previous: v1
current: '2'
previous: '1'
```

- Now on the consuming site we can take action to handle both the old and new config and decide based on the value in
redis which case is executed.

```php
'contentStoreUrl' => 'https://www.vendor.de/' . ($configEpoch === 'v2' ? 'de-de/' : '')
$configEpoch = (int) $redisClient->get('contentStore:configEpoch');
$contentStoreUrl = 'https://www.vendor.de/' . ($configEpoch > 1 ? 'de-de/' : '');
```

## Development
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Flowpack.DecoupledContentStore.BackendController.index = Neos.Fusion:Component {
// - contentStore: contains string content store identifier
// - redisContentStores: array of all configured content store identifiers
// - storeSize: string of content store size
// - toggleFromConfigEpoch: string, e.g. "v2"
// - toggleToConfigEpoch: string, e.g. "v1"
// - toggleFromConfigEpoch: string, e.g. "2"
// - toggleToConfigEpoch: string, e.g. "1"
// - showToggleConfigEpochButton: boolean

renderer = Neos.Fusion:Component {
Expand Down

0 comments on commit c8b0d2c

Please sign in to comment.