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

Fix : Server shouldn't start if HTTP_PORT is blocked #1319

Merged
merged 42 commits into from
Dec 27, 2024

Conversation

coolwednesday
Copy link
Contributor

@coolwednesday coolwednesday commented Dec 19, 2024

Description:

Checklist:

  • I have formatted my code using goimport and golangci-lint.
  • All new code is covered by unit tests.
  • This PR does not decrease the overall code coverage.
  • I have reviewed the code comments and documentation for clarity.

Thank you for your contribution!

Copy link
Member

@Umang01-hash Umang01-hash left a comment

Choose a reason for hiding this comment

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

Can we also add some test covering the new statements of code?

aryanmehrotra
aryanmehrotra previously approved these changes Dec 23, 2024
Umang01-hash
Umang01-hash previously approved these changes Dec 23, 2024
@ccoVeille
Copy link
Contributor

ccoVeille commented Dec 24, 2024

I agree. I raised the point, I was not asking for one solution or another.

With your feedbacks, I think you could simply consider the following:

  • if no port is provided in the conf (via env or anything), the code uses :0 then a free port is computed

It could help for tests.

But you could also use a TestMain and set to freeport, and then no need to provide some in each tests

Of course, it's out of the current PR

I can help on this

Copy link
Member

@aryanmehrotra aryanmehrotra left a comment

Choose a reason for hiding this comment

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

Let's use free port

@aryanmehrotra aryanmehrotra merged commit ffb2372 into gofr-dev:development Dec 27, 2024
12 checks passed
@coolwednesday coolwednesday deleted the http-port branch January 8, 2025 09:14
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.

Server shouldn't start if HTTP_PORT is blocked
5 participants