summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/ci/external/file/remote.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/gitlab/ci/external/file/remote.rb b/lib/gitlab/ci/external/file/remote.rb
index aa089860525..e728e3de77d 100644
--- a/lib/gitlab/ci/external/file/remote.rb
+++ b/lib/gitlab/ci/external/file/remote.rb
@@ -3,6 +3,7 @@ module Gitlab
module External
module File
class Remote
+ include Gitlab::Utils::StrongMemoize
attr_reader :location
def initialize(location, opts = {})
@@ -16,11 +17,13 @@ module Gitlab
def content
return @content if defined?(@content)
- @content ||= begin
- HTTParty.get(location)
- rescue HTTParty::Error, Timeout::Error
- false
- end
+ @content = strong_memoize(:content) do
+ begin
+ HTTParty.get(location)
+ rescue HTTParty::Error, Timeout::Error
+ false
+ end
+ end
end
end
end