Rails + Heroku + Sidekiq = PG ::错误:SSL SYSCALL错误:检测到EOF

时间:2013-03-12 10:20:01

标签: ruby-on-rails activerecord heroku actionmailer sidekiq

我有一个使用Sidekiq的DelayMailer以异步方式发送邮件的rails应用程序。该应用程序部署在heroku上,我们将数据库用于PG。我执行ActionMailer的方法中出现了EOF错误(PG ::错误:SSL SYSCALL错误:检测到EOF)(不是每次都出现)。 当我尝试从ActionMailer方法访问数据库时,似乎出现了错误。

def new_message(user_id, message_id)
  @user = User.find user_id # ERROR appears here when trying to access the DB
...

我不知道发生了什么事。我已经搜索了解决方案,我只找到了一些关于将after_fork和before_fork添加到unicorn.rb的建议,我已经拥有了它,我不确定这是否相关。

0 个答案:

没有答案
相关问题