Rails Resque workers fail with PGError: server closed the connection unexpectedly

后端 未结 5 1165
抹茶落季
抹茶落季 2020-12-07 23:42

I have site running rails application and resque workers running in production mode, on Ubuntu 9.10, Rails 2.3.4, ruby-ee 2010.01, PostgreSQL 8.4.2

Workers constantl

5条回答
  •  忘掉有多难
    2020-12-07 23:54

    When I created Nestor, I had the same kind of problem. The solution was to re-establish the connection in the forked process. See the relevant code at http://github.com/francois/nestor/blob/master/lib/nestor/mappers/rails/test/unit.rb#L162

    From my very limited look at Resque code, I believe a call to #establish_connection should be done right about here: https://github.com/resque/resque/blob/master/lib/resque/worker.rb#L123

提交回复
热议问题