Skip to content
Snippets Groups Projects
Unverified Commit 0c300524 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu :basketball:
Browse files

Use strong memoize utility

parent 6bb1a2ab
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment