[Backgroundrb-devel] Strange problem with ActiveRecord#find in worker

Benjamin H. Bryant iambenbryant at gmail.com
Fri May 23 17:07:25 EDT 2008


I had the same (very frustrating) problem.  Im not entirely sure what  
it's root is, but it seems to be due to mysql not having completely  
finished writing/updating before your worker attempts to find the  
record.  Try adding a sleep(1) (or potentially even less time) in your  
worker method before the find.  That worked for me.


On May 23, 2008, at 5:00 PM, Ruben. D. wrote:

> Hi friends, I've a strange problem with ActiveRecord#find in a  
> worker, this sometimes work fine and somethimes return Nil but the  
> SQL query is fine, I don't know what happen, I was worked a complete  
> day on debugging this, here is my code:
> http://pastie.caboo.se/201986
> Very thanks for your help.
> Regards.
> -- 
> Rubén Dávila Santos.
> http://rubenonrails.com  
> _______________________________________________
> Backgroundrb-devel mailing list
> Backgroundrb-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/backgroundrb-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080523/305e1ea9/attachment.html>

More information about the Backgroundrb-devel mailing list