Madhankumar Nagaraj wrote: > hi, > i have used backgroundrb to update the database with the files having > some useful data, where i am getting files periodically uploaded. > it works well, but suddenly it stops the worker and stopped the > updation. > when i checked the backgroundrb.log file > it shows > Mysql::Error: MySQL server has gone away: (Query used for updation) > LIMIT 1 - (ActiveRecord::StatementInvalid) > but, the query is working fine in mysql. > > i have created one worker to do the updation with job_key. > when i checked the job_key value for the particular worker is shows nil. > since the worker was stopped. > > what would be the problem, how can i make the updation works > continuously.
Your MySQL session is timing-out after the default 8 hours. Either increase the timeout by adding the following line to the [mysqld] section of the /etc/my.cnf file: set-variable = wait_timeout=<#seconds> or you can instead insert a call to ActiveRecord::Base.verify_active_connections! ahead of any database queries. The verify_active_connections! method is called by Rails before every request, but your backgroundrb process will not be getting this constant hammering to keep its database connection alive. -- Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

