diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-12-29 00:14:33 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-12-29 00:38:34 +0300 |
commit | ed214a11ca1566582a084b9dc4b9e79470c1cc18 (patch) | |
tree | 88c20d27690e4f94d13d7bcdba6eacb8e2d709cb /lib/gitlab/metrics.rb | |
parent | af00558d38806eda2fa70c8fdc34be98fced44a4 (diff) |
Handle missing settings table for metrics
This ensures we can still boot, even when the "application_settings"
table doesn't exist.
Diffstat (limited to 'lib/gitlab/metrics.rb')
-rw-r--r-- | lib/gitlab/metrics.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/gitlab/metrics.rb b/lib/gitlab/metrics.rb index 8039e8e9e9d..9470633b065 100644 --- a/lib/gitlab/metrics.rb +++ b/lib/gitlab/metrics.rb @@ -9,12 +9,16 @@ module Gitlab # etc). This ensures the application is able to boot up even when the # migrations have not been executed. def self.settings - ApplicationSetting.current || { - metrics_pool_size: 16, - metrics_timeout: 10, - metrics_enabled: false, - metrics_method_call_threshold: 10 - } + if ApplicationSetting.table_exists? and curr = ApplicationSetting.current + curr + else + { + metrics_pool_size: 16, + metrics_timeout: 10, + metrics_enabled: false, + metrics_method_call_threshold: 10 + } + end end def self.pool_size |