Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
G
GitLab JH validation
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
Show more breadcrumbs
GitLab Org Sandbox
GitLab JH validation
Commits
be08ea0e
Commit
be08ea0e
authored
1 year ago
by
Furkan Ayhan
Browse files
Options
Downloads
Patches
Plain Diff
Use the one-ff strategy
parent
3731f0a5
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/gitlab/ci/config/external/file/remote.rb
+18
-14
18 additions, 14 deletions
lib/gitlab/ci/config/external/file/remote.rb
with
18 additions
and
14 deletions
lib/gitlab/ci/config/external/file/remote.rb
+
18
−
14
View file @
be08ea0e
...
...
@@ -15,21 +15,19 @@ def initialize(params, context)
end
def
preload_content
return
super
if
::
Feature
.
disabled?
(
:ci_parallel_remote_includes
,
context
.
project
)
# It starts fetching the remote content in a separate thread and returns a promise immediately.
@content_lazy_response
=
Gitlab
::
HTTP
.
get
(
location
,
async:
true
).
execute
fetch_async_content
end
def
content
strong_memoize
(
:content
)
do
next
fetch_remote_content
if
::
Feature
.
disabled?
(
:ci_parallel_remote_includes
,
context
.
project
)
fetch_with_error_handling
do
@content_lazy_response
.
value
if
fetch_async_content
fetch_async_content
.
value
else
fetch_sync_content
end
end
end
strong_memoize_attr
:content
def
metadata
super
.
merge
(
...
...
@@ -55,13 +53,19 @@ def validate_location!
private
def
fetch_remote_content
fetch_with_error_handling
do
def
fetch_async_content
return
if
::
Feature
.
disabled?
(
:ci_parallel_remote_includes
,
context
.
project
)
# It starts fetching the remote content in a separate thread and returns a promise immediately.
Gitlab
::
HTTP
.
get
(
location
,
async:
true
).
execute
end
strong_memoize_attr
:fetch_async_content
def
fetch_sync_content
context
.
logger
.
instrument
(
:config_file_fetch_remote_content
)
do
Gitlab
::
HTTP
.
get
(
location
)
end
end
end
def
fetch_with_error_handling
begin
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment