class PendingOrder < ActiveRecord::Base
  def sleep_until_processed
    sleep 0.5
    while !processed?
      reload
      sleep 0.25
    end
  end
end

Aug 10 19:43:38 prod-app1 foo[31608]: PendingOrder Load (0.6ms)
SELECT * FROM `pending_orders` LIMIT 1
Aug 10 19:43:39 prod-app1 foo[31496]: CACHE (0.0ms)   SELECT * FROM
`pending_orders` WHERE (`pending_orders`.`id` = 221)

So the first query is legit -- but second query is cached, and so
forth.  Every subsequent query ends up being a cached value, forever.

How can I make the above method *not* look at a cache?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to