Commit c6465fad authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-spring-reload-admin-client' into 'master'

Fix Spring Reloading AdminMode::Client

See merge request gitlab-org/gitlab!31512
parents d33ad2c0 be419da1
......@@ -8,7 +8,7 @@ module Gitlab
# If enabled then it injects a job field that persists through the job execution
class Client
def call(_worker_class, job, _queue, _redis_pool)
return yield unless Feature.enabled?(:user_mode_in_session)
return yield unless ::Feature.enabled?(:user_mode_in_session)
# Admin mode enabled in the original request or in a nested sidekiq job
admin_mode_user_id = find_admin_user_id
......@@ -16,7 +16,7 @@ module Gitlab
if admin_mode_user_id
job['admin_mode_user_id'] ||= admin_mode_user_id
Gitlab::AppLogger.debug("AdminMode::Client injected admin mode for job: #{job.inspect}")
::Gitlab::AppLogger.debug("AdminMode::Client injected admin mode for job: #{job.inspect}")
end
yield
......@@ -25,8 +25,8 @@ module Gitlab
private
def find_admin_user_id
Gitlab::Auth::CurrentUserMode.current_admin&.id ||
Gitlab::Auth::CurrentUserMode.bypass_session_admin_id
::Gitlab::Auth::CurrentUserMode.current_admin&.id ||
::Gitlab::Auth::CurrentUserMode.bypass_session_admin_id
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment