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

Use strong memoize utility

parent 6bb1a2ab
......@@ -7,6 +7,8 @@ module Gitlab
module Cache
module Ci
class ProjectPipelineStatus
include Gitlab::Utils::StrongMemoize
attr_accessor :sha, :status, :ref, :project, :loaded
def self.load_for_project(project)
......@@ -112,9 +114,9 @@ module Gitlab
end
def commit
return @commit if defined?(@commit)
@commit = project.commit
strong_memoize(:commit) do
project.commit
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