summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 21:07:53 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-27 21:07:53 +0000
commitf50b93c373428d624cc2cabe98e4022dce846e67 (patch)
tree0349e25d3d106aabd6b520afa96ebd35578ab38b /lib
parente20baee820ea2c76ee16980a98e8080f255d9035 (diff)
downloadgitlab-ce-f50b93c373428d624cc2cabe98e4022dce846e67.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/usage_data.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 384f7d159fd..8c0da1ba999 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -202,7 +202,7 @@ module Gitlab
results = {
projects_jira_server_active: 0,
projects_jira_cloud_active: 0,
- projects_jira_active: -1
+ projects_jira_active: 0
}
Service.active
@@ -217,14 +217,12 @@ module Gitlab
results[:projects_jira_server_active] += counts[:server].count if counts[:server]
results[:projects_jira_cloud_active] += counts[:cloud].count if counts[:cloud]
- if results[:projects_jira_active] == -1
- results[:projects_jira_active] = services.size
- else
- results[:projects_jira_active] += services.size
- end
+ results[:projects_jira_active] += services.size
end
results
+ rescue ActiveRecord::StatementInvalid
+ { projects_jira_server_active: -1, projects_jira_cloud_active: -1, projects_jira_active: -1 }
end
# rubocop: enable CodeReuse/ActiveRecord