Commit a2452fe0 authored by Toon Claes's avatar Toon Claes

When rollout status is not yet complete, set Poll-Interval header

This way the frontend knows how often to poll for changes.
parent b5d72807
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment