From 3f4a6412dcc35c182d993cd1350459e8a4a1b8d1 Mon Sep 17 00:00:00 2001
From: Lin Jen-Shin <godfat@godfat.org>
Date: Thu, 7 Apr 2016 05:46:26 +0800
Subject: [PATCH] We should totally cache it

---
 lib/gitlab/email/receiver.rb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/gitlab/email/receiver.rb b/lib/gitlab/email/receiver.rb
index 50c16da4ef6..5f85f7ad03f 100644
--- a/lib/gitlab/email/receiver.rb
+++ b/lib/gitlab/email/receiver.rb
@@ -158,9 +158,7 @@ module Gitlab
       end
 
       def sent_notification
-        return nil unless reply_key
-
-        SentNotification.for(reply_key)
+        @sent_notification ||= SentNotification.for(reply_key) if reply_key
       end
 
       def add_attachments(reply, project)
-- 
GitLab