Skip to content

Commit 7a62ede

Browse files
authored
Update main.go to fix scale to zero functionality (#225)
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.
1 parent 04c1fe7 commit 7a62ede

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/start/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func scaleToZeroWorker(ctx context.Context, node *flypg.Node) error {
154154
continue
155155
}
156156
log.Printf("Current connection count is %d\n", current)
157-
if current >= 1 {
157+
if current > 1 {
158158
continue
159159
}
160160
return fmt.Errorf("scale to zero condition hit")

0 commit comments

Comments
 (0)