Skip to content

Commit e142bb3

Browse files
authored
GODRIVER-2136 Include LatencySelector in change stream server selector (#720)
1 parent 6385557 commit e142bb3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

mongo/change_stream.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,14 @@ func newChangeStream(ctx context.Context, config changeStreamConfig, pipeline in
104104
}
105105

106106
cs := &ChangeStream{
107-
client: config.client,
108-
registry: config.registry,
109-
streamType: config.streamType,
110-
options: options.MergeChangeStreamOptions(opts...),
111-
selector: description.ReadPrefSelector(config.readPreference),
107+
client: config.client,
108+
registry: config.registry,
109+
streamType: config.streamType,
110+
options: options.MergeChangeStreamOptions(opts...),
111+
selector: description.CompositeSelector([]description.ServerSelector{
112+
description.ReadPrefSelector(config.readPreference),
113+
description.LatencySelector(config.client.localThreshold),
114+
}),
112115
cursorOptions: config.client.createBaseCursorOptions(),
113116
}
114117

0 commit comments

Comments
 (0)