Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6bd2e7bb
Commit
6bd2e7bb
authored
Oct 06, 2021
by
Andrejs Cunskis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce log verbosity of every api request
parent
542ca3dc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
qa/qa/support/api.rb
qa/qa/support/api.rb
+1
-1
qa/qa/support/retrier.rb
qa/qa/support/retrier.rb
+18
-4
No files found.
qa/qa/support/api.rb
View file @
6bd2e7bb
...
...
@@ -81,7 +81,7 @@ module QA
def
with_retry_on_too_many_requests
response
=
nil
Support
::
Retrier
.
retry_until
do
Support
::
Retrier
.
retry_until
(
log:
false
)
do
response
=
yield
if
response
.
code
==
HTTP_STATUS_TOO_MANY_REQUESTS
...
...
qa/qa/support/retrier.rb
View file @
6bd2e7bb
...
...
@@ -34,15 +34,29 @@ module QA
result
end
def
retry_until
(
max_attempts:
nil
,
max_duration:
nil
,
reload_page:
nil
,
sleep_interval:
0
,
raise_on_failure:
true
,
retry_on_exception:
false
,
log:
true
)
def
retry_until
(
max_attempts:
nil
,
max_duration:
nil
,
reload_page:
nil
,
sleep_interval:
0
,
raise_on_failure:
true
,
retry_on_exception:
false
,
log:
true
)
# For backwards-compatibility
max_attempts
=
3
if
max_attempts
.
nil?
&&
max_duration
.
nil?
if
log
start_msg
||
=
[
"with retry_until:"
]
start_msg
=
[
"with retry_until:"
]
start_msg
<<
"max_attempts:
#{
max_attempts
}
;"
if
max_attempts
start_msg
<<
"max_duration:
#{
max_duration
}
;"
if
max_duration
start_msg
<<
"reload_page:
#{
reload_page
}
; sleep_interval:
#{
sleep_interval
}
; raise_on_failure:
#{
raise_on_failure
}
; retry_on_exception:
#{
retry_on_exception
}
"
start_msg
.
push
(
*
[
"reload_page:
#{
reload_page
}
;"
,
"sleep_interval:
#{
sleep_interval
}
;"
,
"raise_on_failure:
#{
raise_on_failure
}
;"
,
"retry_on_exception:
#{
retry_on_exception
}
"
])
QA
::
Runtime
::
Logger
.
debug
(
start_msg
.
join
(
' '
))
end
...
...
@@ -58,7 +72,7 @@ module QA
)
do
result
=
yield
end
QA
::
Runtime
::
Logger
.
debug
(
"ended retry_until"
)
QA
::
Runtime
::
Logger
.
debug
(
"ended retry_until"
)
if
log
result
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment