diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-17 12:10:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-17 12:10:02 +0300 |
commit | 0fd229655348c98448022fd293b42666b28eace5 (patch) | |
tree | 341bb5d29db0be64a26ea98b44cb2e794bada8ae /app/experiments | |
parent | 04ebfaf17cfb4c85e29316937d7d44667ccc049f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/experiments')
-rw-r--r-- | app/experiments/application_experiment.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/experiments/application_experiment.rb b/app/experiments/application_experiment.rb index 4ebf4a80498..0dd829e259e 100644 --- a/app/experiments/application_experiment.rb +++ b/app/experiments/application_experiment.rb @@ -12,17 +12,22 @@ class ApplicationExperiment < Gitlab::Experiment # rubocop:disable Gitlab/Namesp def publish(_result = nil) super - publish_to_client if should_track? # publish the experiment data to the client - publish_to_database if @record # publish the experiment context to the database + publish_to_client + publish_to_database end def publish_to_client + return unless should_track? + Gon.push({ experiment: { name => signature } }, true) rescue NoMethodError # means we're not in the request cycle, and can't add to Gon. Log a warning maybe? end def publish_to_database + return unless @record + return unless should_track? + # if the context contains a namespace, group, project, user, or actor value = context.value subject = value[:namespace] || value[:group] || value[:project] || value[:user] || value[:actor] |