Skip to content

Commit

Permalink
Update main.go to fix scale to zero functionality (#225)
Browse files Browse the repository at this point in the history
Currently we're checking if the number of connections is greater-or-equal to 1. However the ConnectionCount query that runs doesn't exclude itself from the result set, so it always returns at least one. 

The >= 1 check was added here: #200. This PR reverts back to the previous `>1 ` check.
  • Loading branch information
swilson-fly authored Apr 8, 2024
1 parent 04c1fe7 commit 7a62ede
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/start/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func scaleToZeroWorker(ctx context.Context, node *flypg.Node) error {
continue
}
log.Printf("Current connection count is %d\n", current)
if current >= 1 {
if current > 1 {
continue
}
return fmt.Errorf("scale to zero condition hit")
Expand Down

0 comments on commit 7a62ede

Please sign in to comment.