diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-03 15:10:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-03 15:10:18 +0300 |
commit | f5987db869d7025fb8f403edc5106c5f2a3e448f (patch) | |
tree | 804c2c04e607f8d5010be1541fac4e325b9d116a /app/models/project_feature_usage.rb | |
parent | e5f183140340a76754af3beabff0fcd74212a102 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/project_feature_usage.rb')
-rw-r--r-- | app/models/project_feature_usage.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/models/project_feature_usage.rb b/app/models/project_feature_usage.rb index d993db860c3..dba81a6cb60 100644 --- a/app/models/project_feature_usage.rb +++ b/app/models/project_feature_usage.rb @@ -20,14 +20,16 @@ class ProjectFeatureUsage < ApplicationRecord end def log_jira_dvcs_integration_usage(cloud: true) - integration_field = self.class.jira_dvcs_integration_field(cloud: cloud) + ::Gitlab::Database::LoadBalancing::Session.without_sticky_writes do + integration_field = self.class.jira_dvcs_integration_field(cloud: cloud) - # The feature usage is used only once later to query the feature usage in a - # long date range. Therefore, we just need to update the timestamp once per - # day - return if persisted? && updated_today?(integration_field) + # The feature usage is used only once later to query the feature usage in a + # long date range. Therefore, we just need to update the timestamp once per + # day + break if persisted? && updated_today?(integration_field) - persist_jira_dvcs_usage(integration_field) + persist_jira_dvcs_usage(integration_field) + end end private |