Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-05-06 15:16:53 +0300
committerSean McGivern <sean@gitlab.com>2016-05-11 11:16:01 +0300
commit5f27e26bb4d073c04fd6d3f4116fc1a122db8c00 (patch)
treea0fea0df79f8e8fae17eb2d5bb1caed099d9b490 /app/mailers
parent48c80fdf43e44ae003753c81a832fc2c0eafdb5d (diff)
Only generate repository push email once
The repository push email can be very expensive to generate, especially with syntax-highlighted diffs. Instead of generating the email for each recipient, generate one email object and reset the Message-Id and To headers for each recipient. (Cloning would also be expensive in the case of large emails, although probably not as bad as generating from scratch.)
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/projects.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/mailers/emails/projects.rb b/app/mailers/emails/projects.rb
index 377c2999d6c..5489283432b 100644
--- a/app/mailers/emails/projects.rb
+++ b/app/mailers/emails/projects.rb
@@ -59,9 +59,9 @@ module Emails
subject: subject("Project was moved"))
end
- def repository_push_email(project_id, recipient, opts = {})
+ def repository_push_email(project_id, opts = {})
@message =
- Gitlab::Email::Message::RepositoryPush.new(self, project_id, recipient, opts)
+ Gitlab::Email::Message::RepositoryPush.new(self, project_id, opts)
# used in notify layout
@target_url = @message.target_url
@@ -72,7 +72,6 @@ module Emails
mail(from: sender(@message.author_id, @message.send_from_committer_email?),
reply_to: @message.reply_to,
- to: @message.recipient,
subject: @message.subject)
end
end