summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index f80f1063406..6a0d32d406e 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -178,7 +178,14 @@ class Commit
end
def author
- @author ||= User.find_by_any_email(author_email.downcase)
+ key = "commit_author:#{author_email}"
+
+ # nil is a valid value since no author may exist in the system
+ unless RequestStore.store.has_key?(key)
+ RequestStore.store[key] = User.find_by_any_email(author_email.downcase)
+ end
+
+ @author ||= RequestStore.store[key]
end
def committer