Skip to content
Snippets Groups Projects
Commit ce97d577 authored by Bob Van Landuyt's avatar Bob Van Landuyt
Browse files

Handle worker timeouts configured as strings

This make sure that worker timeouts configured as a string don't break
the request duration calculation
parent e120063d
No related branches found
No related tags found
No related merge requests found
---
title: Handle worker timeouts configured as strings
merge_request: 3877
author:
type: fixed
Loading
Loading
@@ -246,7 +246,7 @@ module GitlabRails # rubocop:disable Style/MultilineIfModifier
service = Services.enabled?('puma') ? 'puma' : 'unicorn'
user_config = Gitlab[service]
service_config = Gitlab['node']['gitlab'][service]
user_config['worker_timeout'] || service_config['worker_timeout']
(user_config['worker_timeout'] || service_config['worker_timeout']).to_i
end
end
end unless defined?(GitlabRails) # Prevent reloading during converge, so we can test
Loading
Loading
@@ -1970,10 +1970,11 @@ describe 'gitlab::gitlab-rails' do
using RSpec::Parameterized::TableSyntax
 
where(:web_worker, :configured_timeout, :expected_duration) do
:unicorn | nil | 57
:unicorn | 30 | 29
:puma | nil | 57
:puma | 120 | 114
:unicorn | nil | 57
:unicorn | 30 | 29
:unicorn | "30" | 29
:puma | nil | 57
:puma | 120 | 114
end
 
with_them do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment