diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-25 18:10:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-25 18:10:16 +0300 |
commit | 02e4b2d0043b416314ffb76694aff200584352d5 (patch) | |
tree | a7d027891f3089960950d7ec75ba60d981623ab4 /lib/api/helpers.rb | |
parent | 7a3aca2b5b3bfdebbd7bb6353d5bdcdc422670da (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r-- | lib/api/helpers.rb | 13 |
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) |