Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Another attempt to make mongoid cursor not timeout
  • Loading branch information
bdmac authored and Empact committed Mar 26, 2012
1 parent e215686 commit 3620234
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/sunspot/mongoid.rb
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 3620234

Please sign in to comment.