Skip to content

Commit

Permalink
Fix: fix serve min containers threshold (#874)
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-lombardi authored Jan 20, 2025
1 parent 451a09e commit 8b530d6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/abstractions/common/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,12 @@ func (i *AutoscaledInstance) WaitForContainer(ctx context.Context, duration time
}

func (i *AutoscaledInstance) ConsumeScaleResult(result *AutoscalerResult) {
i.ScaleEventChan <- max(result.DesiredContainers, int(i.StubConfig.Autoscaler.MinContainers))
minContainers := int(i.StubConfig.Autoscaler.MinContainers)
if i.Stub.Type.IsServe() {
minContainers = 0
}

i.ScaleEventChan <- max(result.DesiredContainers, minContainers)
}

func (i *AutoscaledInstance) ConsumeContainerEvent(event types.ContainerEvent) {
Expand Down

0 comments on commit 8b530d6

Please sign in to comment.