Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-25 18:10:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-25 18:10:16 +0300
commit02e4b2d0043b416314ffb76694aff200584352d5 (patch)
treea7d027891f3089960950d7ec75ba60d981623ab4 /lib/api/helpers.rb
parent7a3aca2b5b3bfdebbd7bb6353d5bdcdc422670da (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 9e04cf955df..3bbc1d71852 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -700,14 +700,17 @@ module API
Gitlab::AppLogger.warn("Redis tracking event failed for event: #{event_name}, message: #{error.message}")
end
- def track_event(event_name, user_id:, namespace_id: nil, project_id: nil)
- return unless user_id.present?
+ def track_event(event_name, user:, namespace_id: nil, project_id: nil)
+ return unless user.present?
+
+ namespace = Namespace.find(namespace_id) if namespace_id
+ project = Project.find(project_id) if project_id
Gitlab::InternalEvents.track_event(
event_name,
- user_id: user_id,
- namespace_id: namespace_id,
- project_id: project_id
+ user: user,
+ namespace: namespace,
+ project: project
)
rescue StandardError => e
Gitlab::ErrorTracking.track_and_raise_for_dev_exception(e, event_name: event_name)