Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.go to fix scale to zero functionality #225

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

swilson-fly
Copy link
Contributor

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 current >1 check.

An alternate way to fix this would be to change the query in the getCurrentConnCount func to use the SUCredentials instead of OperatorCredentials. This would run the query as the flypgadmin user (which is excluded from the query) instead of the Postgres user.

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: fly-apps#200. This PR reverts back to the previous `>1 ` check.
@davissp14 davissp14 requested a review from DAlperin March 29, 2024 14:40
Copy link
Member

@DAlperin DAlperin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me

@davissp14 davissp14 merged commit 7a62ede into fly-apps:master Apr 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants