{"action":"created","issue":{"url":"https://api.github.com/repos/nesquena/backburner/issues/90","labels_url":"https://api.github.com/repos/nesquena/backburner/issues/90/labels{/name}","comments_url":"https://api.github.com/repos/nesquena/backburner/issues/90/comments","events_url":"https://api.github.com/repos/nesquena/backburner/issues/90/events","html_url":"https://github.com/nesquena/backburner/issues/90","id":64924659,"number":90,"title":"How to recover DB connection between two jobs in production ?","user":{"login":"geoffroymontel","id":352910,"avatar_url":"https://avatars.githubusercontent.com/u/352910?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffroymontel","html_url":"https://github.com/geoffroymontel","followers_url":"https://api.github.com/users/geoffroymontel/followers","following_url":"https://api.github.com/users/geoffroymontel/following{/other_user}","gists_url":"https://api.github.com/users/geoffroymontel/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffroymontel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffroymontel/subscriptions","organizations_url":"https://api.github.com/users/geoffroymontel/orgs","repos_url":"https://api.github.com/users/geoffroymontel/repos","events_url":"https://api.github.com/users/geoffroymontel/events{/privacy}","received_events_url":"https://api.github.com/users/geoffroymontel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-28T10:04:44Z","updated_at":"2015-10-08T04:32:42Z","closed_at":null,"body":"Using backburner with `ThreadsOnFork` in production with Rails 4.2 and postgresql.\r\n\r\nIf I stop and restart the postgresql service on my Linux box, Rails can reconnect to the new postgresql service but the workers can't access to the new instance of the database.\r\n\r\nI'm getting a `PG::UnableToSend: no connection to the server` error when the postgresql service is stopped and after it's restarted.\r\n\r\nSome people had the same kind of problem with other queueing systems, and they recommend to run something like this \r\n\r\n```ruby\r\nResque.after_fork = Proc.new { ActiveRecord::Base.establish_connection }\r\n```\r\n\r\nHow can I achieve this with Backburner ?\r\n\r\nShould I put this in `config.on_error` ?"},"comment":{"url":"https://api.github.com/repos/nesquena/backburner/issues/comments/146417403","html_url":"https://github.com/nesquena/backburner/issues/90#issuecomment-146417403","issue_url":"https://api.github.com/repos/nesquena/backburner/issues/90","id":146417403,"user":{"login":"contentfree","id":10958,"avatar_url":"https://avatars.githubusercontent.com/u/10958?v=3","gravatar_id":"","url":"https://api.github.com/users/contentfree","html_url":"https://github.com/contentfree","followers_url":"https://api.github.com/users/contentfree/followers","following_url":"https://api.github.com/users/contentfree/following{/other_user}","gists_url":"https://api.github.com/users/contentfree/gists{/gist_id}","starred_url":"https://api.github.com/users/contentfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/contentfree/subscriptions","organizations_url":"https://api.github.com/users/contentfree/orgs","repos_url":"https://api.github.com/users/contentfree/repos","events_url":"https://api.github.com/users/contentfree/events{/privacy}","received_events_url":"https://api.github.com/users/contentfree/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T04:32:42Z","updated_at":"2015-10-08T04:32:42Z","body":"I've actually been working on this the past couple days (it's coming as a side effect of handling dead connections to beanstalk). \n\nThe first revision will use the existing hook system so you'll likely need to either reopen the world class that you're using or subclass and extend. "}}