ActionMailer超时 [英] ActionMailer Timing out

查看:133
本文介绍了ActionMailer超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Rails 3.2.17 ActionMailer 发送电子邮件。在开发环境中,我使用了Google帐户发送电子邮件,并且效果很好。在生产环境中,使用生产电子邮件设置会超时。为了验证,我将生产设置复制到了dev。

I'm using Rails 3.2.17 and ActionMailer to send out emails. In the development environment I used my google account to send email and it worked fine. On production, with the production email settings it's timing out. To verify I copied over the production settings to dev.

当前它以很少的信息失败:

Currently it's failing with very little info:

Rendered notifications_mailer/access_granted.html.haml (2.8ms)
  Rendered notifications_mailer/access_granted.text.haml (1.5ms)
E, [2014-03-27T12:15:16.066641 #36665] ERROR -- : worker=1 PID:36673 timeout (16s > 15s), killing
E, [2014-03-27T12:15:16.079432 #36665] ERROR -- : reaped #<Process::Status: pid 36673 SIGKILL (signal 9)> worker=1
I, [2014-03-27T12:15:16.096443 #36684]  INFO -- : worker=1 ready

SMTP设置

config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address:              "secure.emailsrvr.com",
  port:                 465,
  domain:               "MYDOMAIN.net",
  authentication:       :plain,
  enable_starttls_auto: true,
  user_name:            "no-reply@MYDOMAIN.net",
  password:             "MYPASSWORD"

我已经使用telnet确认主机和端口,但是当我尝试根据本教程发送邮件时它使我与世隔绝。

I've used telnet to confirm the host and port, however when I try to send mail according to this tutorial it disconnects me.

Telnet控制台

$ telnet secure.emailsrvr.com 465
Trying 166.78.79.129...
Connected to secure.emailsrvr.com.
Escape character is '^]'.
hello me
Mail from: no-reply@MYDOMAIN.net
Connection closed by foreign host.

此外,我还使用此信息和 AM设置了我的电子邮件应用程序(Mac Mail) 能够使用这些设置发送电子邮件。

Additionally, I've setup my email app (Mac Mail) with this information and AM able to send email with these settings.

任何有关如何解决此问题的建议将不胜感激。

Any advice on how to approach troubleshooting this would be greatly appreciated.

推荐答案

您应该增加数据库yml文件中的池时间。
它将消除超时问题。

you should increase pool time in your database yml file. It will eliminate time out problem.

这篇关于ActionMailer超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆