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

Add listTopics to Admin #718

Merged
merged 13 commits into from
May 8, 2020
Merged

Add listTopics to Admin #718

merged 13 commits into from
May 8, 2020

Conversation

dashie
Copy link
Contributor

@dashie dashie commented May 6, 2020

No description provided.

@dashie dashie mentioned this pull request May 7, 2020
/**
* @return {Promise}
*/
const listTopics = async () => {
Copy link
Collaborator

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?

* @return {Promise}
*/
const listTopics = async () => {
await cluster.refreshMetadata()
Copy link
Collaborator

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.

*/
const listTopics = async () => {
await cluster.refreshMetadata()
const { topicMetadata } = await cluster.metadata({ topics: [] })
Copy link
Collaborator

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.

@Nevon Nevon merged commit 7eaa353 into tulios:master May 8, 2020
@Nevon
Copy link
Collaborator

Nevon commented May 8, 2020

Thank you for the contribution!

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