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

feat: Use task broker's health endpoint #32

Merged

Conversation

tomi
Copy link
Contributor

@tomi tomi commented Nov 27, 2024

Task broker now has a health endpoint, which we can now use. That way we don't need the n8n's api server's URI anymore, simplifying the config.

Related PR: n8n-io/n8n#11920

Task broker now has a health endpoint, which we can now use. That
way we don't need the n8n's api server's URI anymore, simplifying
the config.
Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

Lovely idea! Some comments to prevent confusion in future

internal/http/check_until_broker_ready.go Show resolved Hide resolved
@@ -23,16 +23,16 @@ func sendReadinessRequest(n8nMainServerURI string) (*http.Response, error) {
return client.Do(req)
}

// CheckUntilN8nReady checks forever until the n8n main instance is ready, i.e.
// CheckUntilBrokerReady checks forever until the task broker is ready, i.e.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// CheckUntilBrokerReady checks forever until the task broker is ready, i.e.
// CheckUntilBrokerReady checks forever until the task broker server is ready, i.e.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we need to repeat the server everywhere. Task broker is a server

internal/http/check_until_broker_ready.go Show resolved Hide resolved
internal/http/check_until_broker_ready.go Show resolved Hide resolved
internal/ws/handshake.go Outdated Show resolved Hide resolved
internal/env/env.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/http/check_until_broker_ready.go 0.00% 32 Missing ⚠️
internal/commands/launch.go 0.00% 5 Missing ⚠️
internal/ws/handshake.go 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@ivov ivov left a comment

Choose a reason for hiding this comment

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

🚀

@tomi tomi merged commit 88096f6 into main Nov 27, 2024
2 checks passed
@tomi tomi deleted the cat-368-add-healthcheck-endpoint-for-task-broker-and-use-that branch November 27, 2024 12:51
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