From e32aa48399784e410db900a90e4db5356cd2a3cb Mon Sep 17 00:00:00 2001 From: Sebastian Silva Date: Wed, 11 Sep 2019 21:16:54 -0500 Subject: [PATCH] Hotfix: Retry and set timeout to 60 --- script/mailman_server | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/script/mailman_server b/script/mailman_server index ea5bb4a629..981f9daff7 100755 --- a/script/mailman_server +++ b/script/mailman_server @@ -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 @@ -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