summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-09-05 13:35:23 +0100
committerSean McGivern <sean@gitlab.com>2018-09-05 17:51:47 +0100
commitf5f439f2c91f7508f32c136115b0f9bcd6186672 (patch)
treebec4d2db084a17c3a9484c423a86eff8a6de0d60
parentd13ae9c26017eae42b0aaf7de5741e4b768967c6 (diff)
downloadgitlab-ce-f5f439f2c91f7508f32c136115b0f9bcd6186672.tar.gz
Ensure services counts always have values in usage pings
-rw-r--r--lib/gitlab/usage_data.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index e5c7c260c97..957908f183d 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -121,7 +121,7 @@ module Gitlab
}
results = count(Service.unscoped.where(type: types.keys, active: true).group(:type), fallback: Hash.new(-1))
- results.each_with_object({}) { |(key, value), response| response[types[key.to_sym]] = value }
+ types.each_with_object({}) { |(klass, key), response| response[key] = results[klass.to_s] || 0 }
end
def count(relation, fallback: -1)