Commit 90065a30 authored by Imre Farkas's avatar Imre Farkas

Merge branch 'mmj-reset-object-after-obtaining-lock' into 'master'

For RefreshAuthorizedProjectsService, reset the user only after obtaining the lease

See merge request gitlab-org/gitlab!63013
parents e72417af 1a84f1be
......@@ -24,11 +24,6 @@ module Users
@source = source
@incorrect_auth_found_callback = incorrect_auth_found_callback
@missing_auth_found_callback = missing_auth_found_callback
# We need an up to date User object that has access to all relations that
# may have been created earlier. The only way to ensure this is to reload
# the User object.
user.reset
end
def execute
......@@ -43,6 +38,10 @@ module Users
end
begin
# We need an up to date User object that has access to all relations that
# may have been created earlier. The only way to ensure this is to reload
# the User object.
user.reset
execute_without_lease
ensure
Gitlab::ExclusiveLease.cancel(lease_key, uuid)
......
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