Skip to content
This repository was archived by the owner on Oct 23, 2018. It is now read-only.

Commit

Permalink
Another attempt to make mongoid cursor not timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
bdmac committed Jan 4, 2012
1 parent db8ff74 commit 4c56078
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sunspot/mongoid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ module ClassMethods
# we'll change it to work more efficiently with Mongoid.
def solr_index(opt={})
0.step(count, 1000) do |offset|
records = limit(1000).skip(offset).to_a
records = []
limit(1000).skip(offset).each do |r|
records << r
end
Sunspot.index!(records)
end
end
Expand Down

0 comments on commit 4c56078

Please sign in to comment.