summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-05-11 12:45:39 +0000
committerRobert Speicher <robert@gitlab.com>2016-05-11 12:45:39 +0000
commitd526cda5028c9b55241a6996f32cc6a967e8fcba (patch)
treefbe19e13916b204efb0db1d899693311fa092b78 /lib
parente9706b2f9bcf5f9f914e414056d02c523224d618 (diff)
parent5f27e26bb4d073c04fd6d3f4116fc1a122db8c00 (diff)
downloadgitlab-ce-d526cda5028c9b55241a6996f32cc6a967e8fcba.tar.gz
Merge branch '17270-only-generate-email-on-push-once-for-all-recipients' into 'master'
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.) Closes #17270. See merge request !4070
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/email/message/repository_push.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/gitlab/email/message/repository_push.rb b/lib/gitlab/email/message/repository_push.rb
index 8f9be6cd9a3..2c91a0487c3 100644
--- a/lib/gitlab/email/message/repository_push.rb
+++ b/lib/gitlab/email/message/repository_push.rb
@@ -2,7 +2,6 @@ module Gitlab
module Email
module Message
class RepositoryPush
- attr_accessor :recipient
attr_reader :author_id, :ref, :action
include Gitlab::Routing.url_helpers
@@ -11,13 +10,12 @@ module Gitlab
delegate :name, to: :author, prefix: :author
delegate :username, to: :author, prefix: :author
- def initialize(notify, project_id, recipient, opts = {})
+ def initialize(notify, project_id, opts = {})
raise ArgumentError, 'Missing options: author_id, ref, action' unless
opts[:author_id] && opts[:ref] && opts[:action]
@notify = notify
@project_id = project_id
- @recipient = recipient
@opts = opts.dup
@author_id = @opts.delete(:author_id)