Skip to content

Commit

Permalink
Use a none map for the toRetry topics instead of bool
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanbergen committed Apr 10, 2015
1 parent 34f21c8 commit 42e484d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ func (client *client) updateMetadata(data *MetadataResponse) ([]string, error) {
client.registerBroker(broker)
}

toRetry := make(map[string]bool)
toRetry := make(map[string]none)

var err error
for _, topic := range data.Topics {
Expand All @@ -615,10 +615,10 @@ func (client *client) updateMetadata(data *MetadataResponse) ([]string, error) {
continue
case ErrUnknownTopicOrPartition: // retry, do not store partial partition results
err = topic.Err
toRetry[topic.Name] = true
toRetry[topic.Name] = none{}
continue
case ErrLeaderNotAvailable: // retry, but store partiial partition results
toRetry[topic.Name] = true
toRetry[topic.Name] = none{}
break
default: // don't retry, don't store partial results
Logger.Printf("Unexpected topic-level metadata error: %s", topic.Err)
Expand All @@ -630,7 +630,7 @@ func (client *client) updateMetadata(data *MetadataResponse) ([]string, error) {
for _, partition := range topic.Partitions {
client.metadata[topic.Name][partition.ID] = partition
if partition.Err == ErrLeaderNotAvailable {
toRetry[topic.Name] = true
toRetry[topic.Name] = none{}
}
}

Expand Down

0 comments on commit 42e484d

Please sign in to comment.