Skip to content

Commit

Permalink
handle edge case
Browse files Browse the repository at this point in the history
FuhuXia committed Feb 7, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9484740 commit 1248441
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/scale_calculate.sh
Original file line number Diff line number Diff line change
@@ -61,7 +61,8 @@ function set_scale_number {
export scale_to=$((total_instances + SCALE_STEP))
echo "Scaling up to $scale_to"
elif [ "$scale_direction" == "down" ] && [ "$total_instances" -gt "$MIN_INSTANCES" ]; then
export scale_to=$((total_instances - SCALE_STEP))
# export the scale_to value but make sure scale_to is large than 1
export scale_to=$((total_instances - SCALE_STEP < 1 ? 1 : total_instances - SCALE_STEP))
echo "Scaling down to $scale_to"
else
export scale_to="$total_instances"

0 comments on commit 1248441

Please sign in to comment.