File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -708,18 +708,11 @@ def _maybe_refresh_metadata(self):
708
708
self ._last_no_node_available_ms = time .time () * 1000
709
709
return timeout
710
710
711
- topics = list (self ._topics )
712
- if self .cluster .need_all_topic_metadata :
713
- if self .config ['api_version' ] < (0 , 10 ):
714
- topics = []
715
- else :
716
- topics = None
717
-
718
711
if self ._can_send_request (node_id ):
719
- if self . config [ 'api_version' ] < ( 0 , 10 ):
720
- api_version = 0
721
- else :
722
- api_version = 1
712
+ topics = list ( self . _topics )
713
+ if self . cluster . need_all_topic_metadata or not topics :
714
+ topics = [] if self . config [ 'api_version' ] < ( 0 , 10 ) else None
715
+ api_version = 0 if self . config [ ' api_version' ] < ( 0 , 10 ) else 1
723
716
request = MetadataRequest [api_version ](topics )
724
717
log .debug ("Sending metadata request %s to node %s" , request , node_id )
725
718
future = self .send (node_id , request )
You can’t perform that action at this time.
0 commit comments