lib/mongo/retryable.rb in mongo-2.13.3 vs lib/mongo/retryable.rb in mongo-2.14.0.rc1
- old
+ new
@@ -57,10 +57,17 @@
#
# @return [ Cursor ] The cursor for the result set.
def read_with_retry_cursor(session, server_selector, view, &block)
read_with_retry(session, server_selector) do |server|
result = yield server
- Cursor.new(view, result, server, session: session)
+
+ # RUBY-2367: This will be updated to allow the query cache to
+ # cache cursors with multi-batch results.
+ if QueryCache.enabled? && !view.collection.system_collection?
+ CachingCursor.new(view, result, server, session: session)
+ else
+ Cursor.new(view, result, server, session: session)
+ end
end
end
# Execute a read operation with retrying.
#