daytona
daytona copied to clipboard
fix: check if the port is ready to serve
fix: check if the port is ready to serve
Description
CheckPortReady
checks if a service is ready on the specified port by making an HTTP GET request.
Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update
Checklist
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
Related Issue(s)
closes #68
Hi @harkiratsm,
Thanks for opening a PR to resolve the issue.
A couple of notes from my side:
- Please drop the lint commit as it introduces a lot of file changes out of scope of this PR. We will soon enforce linting before commiting so that will be handled.
- Please refer to my comment on the issue at hand. An arbitrary timeout is not a good solution for this. I would suggest implementing a waiting strategy in the
ForwardPort
function that will wait for the port to be ready before returning from the function itself.
Got it. I added a function to check the port's readiness every 0.5 seconds
. Once it's ready, we open the URL in the browser.
@harkiratsm one more thing,
Please read our CONTRIBUTING guidelines and open a separate PR where you will add yourself as a contributor. (example PR)
@harkiratsm, we just updated our policy to contribute to the repo.
This change requires all commits to be signed off with your name and email. You can find out more about the change in this commit.
Please read through the change, squash your commits and sign them like this:
git rebase -i HEAD~X where X is the number of commits
git commit --amend --signoff
Signoff will automatically include the signature required to be a contributor to Daytona.
Let me know if you have any questions about this process or need any help.
All of my commits are signed off with my name and email in this PR.
@harkiratsm, the PR looks great, but I'll have to ask you to change the name in your signature.
As per the DCO requirements, the signature does not necessarily need to be your full name, but something that provides enough identification for us to contact you if need be.
I suggest using your first and last name as it makes it easier and removes any ambiguity from our side.