-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
Add listTopics to Admin #718
Conversation
/** | ||
* @return {Promise} | ||
*/ | ||
const listTopics = async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a test for this change as well?
src/admin/index.js
Outdated
* @return {Promise} | ||
*/ | ||
const listTopics = async () => { | ||
await cluster.refreshMetadata() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be necessary. cluster.metadata
will refresh if it needs to. refreshMetadata
will also just refresh metadata for topics it knows about, so it wouldn't be able to discover new topics anyway.
src/admin/index.js
Outdated
*/ | ||
const listTopics = async () => { | ||
await cluster.refreshMetadata() | ||
const { topicMetadata } = await cluster.metadata({ topics: [] }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ topics: []}
is already the default behavior for cluster.metadata
, so no need to pass it in.
Thank you for the contribution! |
No description provided.