1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

chore[demo]: update handling of strategy deletion for demo walkthrough (#7719)

This PR makes some small changes to how we handle strategy deletion in
the demo environment, which has become extra important with the recent
soft limits.

The changes are:
- lower the strategy limit from 30 to 25. The standard limit is 30, so
we want to make sure we're below that.
- when checking whether we should delete a strategy, check whether we're
**at or above** the limit. It used to only check if we were above, but
if soft limits would prevent you from adding more, then you'd never be
able to go above the limit.
- Also delete strategies for step3.
This commit is contained in:
Thomas Heartman 2024-08-02 11:13:42 +02:00 committed by GitHub
parent a676b1bc20
commit ca35ca1b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,6 +33,7 @@ export const specificUser = async () => {
};
export const gradualRollout = async () => {
await deleteOldStrategies('demoApp.step3');
const featureId = 'demoApp.step3';
const { environments }: IFeatureToggle = await fetch(
@ -97,8 +98,8 @@ const deleteOldStrategies = async (featureId: string) => {
),
);
const strategyLimit = 30;
if (constrainedStrategies.length > strategyLimit) {
const strategyLimit = 25;
if (constrainedStrategies.length >= strategyLimit) {
await Promise.all(
constrainedStrategies
.slice(0, strategyLimit - 1)