1

A background job polls devices table in a Mongoid mapped database in a Rails 4.0.2 application like that:

while go
  Device.all.each do |device|
    #do something
  end
end

I can verify that it load the first set correctly. However, it doesn't refresh the set if new devices are added to the database.

Identity map is off (removed in the current version).

1
  • 1
    Mongoid::QueryCache.enabled = false
    – yanychar
    Jan 21, 2014 at 20:26

1 Answer 1

1

This does the trick:

Mongoid::QueryCache.enabled = false

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.