Commit 0c300524 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Use strong memoize utility

parent 6bb1a2ab
...@@ -7,6 +7,8 @@ module Gitlab ...@@ -7,6 +7,8 @@ module Gitlab
module Cache module Cache
module Ci module Ci
class ProjectPipelineStatus class ProjectPipelineStatus
include Gitlab::Utils::StrongMemoize
attr_accessor :sha, :status, :ref, :project, :loaded attr_accessor :sha, :status, :ref, :project, :loaded
def self.load_for_project(project) def self.load_for_project(project)
...@@ -112,9 +114,9 @@ module Gitlab ...@@ -112,9 +114,9 @@ module Gitlab
end end
def commit def commit
return @commit if defined?(@commit) strong_memoize(:commit) do
project.commit
@commit = project.commit end
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment