We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0b15e7f commit dc35faeCopy full SHA for dc35fae
mongo/cursor.go
@@ -195,7 +195,8 @@ func (c *Cursor) next(ctx context.Context, nonBlocking bool) bool {
195
// operation-level timeout via contexts to a constructor and then that timeout
196
// later be applied while working with a resulting cursor. Instead, it is more
197
// idiomatic to apply the timeout to the context passed to Next or TryNext.
198
- if !nonBlocking && !mongoutil.TimeoutWithinContext(ctx, c.bc.MaxAwaitTime()) {
+ maxAwaitTime := c.bc.MaxAwaitTime() //
199
+ if maxAwaitTime != nil && !nonBlocking && !mongoutil.TimeoutWithinContext(ctx, *maxAwaitTime) {
200
c.err = fmt.Errorf("MaxAwaitTime must be less than the operation timeout")
201
202
return false
0 commit comments