Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot
2023-02-24 06:09:47 +00:00
parent 201a883bdf
commit e3dc4fc8f5
8 changed files with 75 additions and 16 deletions

View File

@ -10,8 +10,11 @@ module Gitlab
start_time = Gitlab::Metrics::System.monotonic_time
retry_attempts = 0
# prevent scope override, see https://gitlab.com/gitlab-org/gitlab/-/issues/391186
klass = subject.is_a?(ActiveRecord::Relation) ? subject.klass : subject.class
begin
subject.transaction do
klass.transaction do
yield(subject)
end
rescue ActiveRecord::StaleObjectError