File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -265,8 +265,14 @@ def srv_max_hosts(self) -> int:
265
265
def _apply_local_threshold (self , selection : Optional [Selection ]) -> list [ServerDescription ]:
266
266
if not selection :
267
267
return []
268
+ round_trip_times : list [float ] = []
269
+ for server in selection .server_descriptions :
270
+ if server .round_trip_time is None :
271
+ config_err_msg = f"round_trip_time for server { server .address } is unexpectedly None: { self } , servers: { selection .server_descriptions } "
272
+ raise ConfigurationError (config_err_msg )
273
+ round_trip_times .append (server .round_trip_time )
268
274
# Round trip time in seconds.
269
- fastest = min (cast ( float , s . round_trip_time ) for s in selection . server_descriptions )
275
+ fastest = min (round_trip_times )
270
276
threshold = self ._topology_settings .local_threshold_ms / 1000.0
271
277
return [
272
278
s
You can’t perform that action at this time.
0 commit comments