gpt4 book ai didi

ruby-on-rails - 亚马逊网络服务 SES smtp 超时

转载 作者:行者123 更新时间:2023-12-02 10:47:00 25 4
gpt4 key购买 nike

我正在使用 AWS SES 在我的 Rails 4 Web 应用程序中向客户发送通知电子邮件。当发送电子邮件时,我发现很多时候由于SES中的SMTP超时错误而导调用子邮件发送失败。最后,经过几次重试后,电子邮件已发送,但我不想再重试。

我无需更改应用程序中的任何内容即可发送电子邮件,重试后即可正常工作。

附上错误日志:

{ 70220114991960 rufus-scheduler intercepted an error:
70220114991960 job:
70220114991960 Rufus::Scheduler::EveryJob "60s" {}
70220114991960 error:
70219770058060
70219770058060 Net::OpenTimeout
70219770058060 execution expired
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `initialize'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `open'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `tcp_socket'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:551:in `block in do_start'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `call'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `timeout'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:550:in `do_start'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:520:in `start'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mail-2.5.4/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mail-2.5.4/lib/mail/message.rb:2129:in `do_delivery'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mail-2.5.4/lib/mail/message.rb:232:in `block in deliver'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/actionmailer-4.0.0/lib/action_mailer/base.rb:456:in `block in deliver_mail'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.0.0/lib/active_support/notifications.rb:159:in `block in instrument'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.0.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/activesupport-4.0.0/lib/active_support/notifications.rb:159:in `instrument'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/actionmailer-4.0.0/lib/action_mailer/base.rb:454:in `deliver_mail'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/mail-2.5.4/lib/mail/message.rb:232:in `deliver'
70219770058060 /home/ubuntu/env/test/www/yanpyapi-test/app/models/notification_manager.rb:40:in `notify'
70219770058060 /home/ubuntu/env/test/www/yanpyapi-test/app/models/events/boat_provider_payment_event.rb:104:in `execute'
70219770058060 /home/ubuntu/env/test/www/yanpyapi-test/app/models/secretary.rb:87:in `block in executeEvents'
70219770058060 /home/ubuntu/env/test/www/yanpyapi-test/app/models/secretary.rb:20:in `each'
70219770058060 /home/ubuntu/env/test/www/yanpyapi-test/app/models/secretary.rb:20:in `executeEvents'
70219770058060 /home/ubuntu/env/test/www/yanpyapi-test/config/initializers/task_scheduler.rb:9:in `block in <top (required)>'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rufus-scheduler-3.0.3/lib/rufus/scheduler/jobs.rb:224:in `call'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rufus-scheduler-3.0.3/lib/rufus/scheduler/jobs.rb:224:in `do_trigger'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rufus-scheduler-3.0.3/lib/rufus/scheduler/jobs.rb:269:in `block (3 levels) in start_work_thread'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rufus-scheduler-3.0.3/lib/rufus/scheduler/jobs.rb:272:in `call'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rufus-scheduler-3.0.3/lib/rufus/scheduler/jobs.rb:272:in `block (2 levels) in start_work_thread'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rufus-scheduler-3.0.3/lib/rufus/scheduler/jobs.rb:258:in `loop'
70219770058060 /home/ubuntu/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rufus-scheduler-3.0.3/lib/rufus/scheduler/jobs.rb:258:in `block in start_work_thread'
} 70219770058060 .

最佳答案

看起来只需更改我的 Rails 应用程序中的 SMTP 端口配置即可工作。我将端口更改为587。

关于ruby-on-rails - 亚马逊网络服务 SES smtp 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28084728/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com