Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: Retry and set timeout to 60 #6275

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions script/mailman_server
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Mailman.config.logger = Logger.new("log/mailman.log")

Mailman.config.ignore_stdin = true #ignore input from STDIN

Mailman.config.poll_interval = 20 # To poll for mails in every 5 seconds
Mailman.config.poll_interval = 60 # To poll for mails in every 5 seconds


# Email Configration for mailman
Expand All @@ -24,18 +24,18 @@ Mailman::Application.run do
# route for mail having node with id in their subject will only be accepted for processing
default do
# REMOVING ENTIRE 'begin/rescue' loop to try to address mailmain issues
# begin
# retries ||= 0
begin
retries ||= 0
# do something with the database that does not fetch mails yet (let's try to ensure we have a MySQL connection first)
puts Comment.last.inspect
Comment.receive_mail(message)
# rescue Exception => e
# Mailman.logger.error "Exception occurred while receiving message:\n#{message}"
# Mailman.logger.error [e, *e.backtrace].join("\n")
# Seeing major site slowdowns; commenting out for now;
# https://github.com/publiclab/plots2/issues/5817
# retry if (retries += 1) < 3
# end
rescue Exception => e
Mailman.logger.error "Exception occurred while receiving message:\n#{message}"
Mailman.logger.error [e, *e.backtrace].join("\n")
# Seeing major site slowdowns; commenting out for now;
# https://github.com/publiclab/plots2/issues/5817
retry if (retries += 1) < 3
end
end

end