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
a2452fe0
Commit
a2452fe0
authored
Apr 06, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When rollout status is not yet complete, set Poll-Interval header
This way the frontend knows how often to poll for changes.
parent
b5d72807
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+2
-0
spec/controllers/projects/environments_controller_spec.rb
spec/controllers/projects/environments_controller_spec.rb
+1
-0
No files found.
app/controllers/projects/environments_controller.rb
View file @
a2452fe0
...
...
@@ -132,6 +132,8 @@ class Projects::EnvironmentsController < Projects::ApplicationController
rollout_status
=
@environment
.
rollout_status
Gitlab
::
PollingInterval
.
set_header
(
response
,
interval:
3000
)
unless
rollout_status
.
try
(
:complete?
)
if
rollout_status
.
nil?
render
body:
nil
,
status:
204
# no result yet
else
...
...
spec/controllers/projects/environments_controller_spec.rb
View file @
a2452fe0
...
...
@@ -266,6 +266,7 @@ describe Projects::EnvironmentsController do
get
:status
,
environment_params
expect
(
response
.
status
).
to
eq
(
204
)
expect
(
response
.
headers
[
'Poll-Interval'
]).
to
eq
(
3000
)
end
it
'returns the rollout status when present'
do
...
...
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