summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-06-10 13:31:59 +0530
committerTimothy Andrew <mail@timothyandrew.net>2016-06-10 13:31:59 +0530
commit57bf3a662ba229aa5a64723b6420d176dd0312be (patch)
tree11cab04f553fc2314da3fee65b82d61b2139db49
parent7836af4910853d05d6427ff3a502aeb6932338d0 (diff)
downloadgitlab-ce-18447-investigate-smtp-error.tar.gz
-rw-r--r--app/workers/emails_on_push_worker.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/workers/emails_on_push_worker.rb b/app/workers/emails_on_push_worker.rb
index 34f38fbab5a..d3d927038a2 100644
--- a/app/workers/emails_on_push_worker.rb
+++ b/app/workers/emails_on_push_worker.rb
@@ -54,6 +54,8 @@ class EmailsOnPushWorker
end
end
+ puts "EmailOnPushWorker: Trying to send email"
+
recipients.split.each do |recipient|
begin
send_email(
@@ -71,7 +73,13 @@ class EmailsOnPushWorker
# These are input errors and won't be corrected even if Sidekiq retries
rescue Net::SMTPFatalError, Net::SMTPSyntaxError => e
+ puts "EmailOnPushWorker: Exception"
logger.info("Failed to send e-mail for project '#{project.name_with_namespace}' to #{recipient}: #{e}")
+ puts
+ puts
+ puts e.backtrace
+ puts
+ puts
end
end
ensure
@@ -85,11 +93,17 @@ class EmailsOnPushWorker
def send_email(recipient, project_id, options)
# Generating the body of this email can be expensive, so only do it once
@skip_premailer ||= email.present?
+ puts "EmailOnPushWorker: @skip_premailer is #{@skip_premailer}"
@email ||= Notify.repository_push_email(project_id, options)
+ puts "EmailOnPushWorker: @email is #{@email}"
+
email.to = recipient
email.add_message_id
email.header[:skip_premailer] = true if skip_premailer
+
+ puts "EmailOnPushWorker: About to send email"
email.deliver_now
+ puts "EmailOnPushWorker: Sent email"
end
end