Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
30ef440f
Commit
30ef440f
authored
Jan 27, 2022
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Import/Export ObjectBuilder to not use Project.transaction
parent
0f17f745
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
15 deletions
+7
-15
lib/gitlab/import_export/base/object_builder.rb
lib/gitlab/import_export/base/object_builder.rb
+7
-1
lib/gitlab/import_export/group/object_builder.rb
lib/gitlab/import_export/group/object_builder.rb
+0
-6
lib/gitlab/import_export/project/object_builder.rb
lib/gitlab/import_export/project/object_builder.rb
+0
-8
No files found.
lib/gitlab/import_export/base/object_builder.rb
View file @
30ef440f
...
...
@@ -31,12 +31,18 @@ module Gitlab
def
find
find_with_cache
do
find_object
||
klass
.
create
(
prepare_attributes
)
find_object
||
create_object
end
end
protected
def
create_object
klass
.
transaction
do
klass
.
create
(
prepare_attributes
)
end
end
def
where_clauses
raise
NotImplementedError
end
...
...
lib/gitlab/import_export/group/object_builder.rb
View file @
30ef440f
...
...
@@ -9,12 +9,6 @@ module Gitlab
# `Group::ObjectBuilder.build(Label, label_attributes)`
# finds or initializes a label with the given attributes.
class
ObjectBuilder
<
Base
::
ObjectBuilder
def
self
.
build
(
*
args
)
::
Group
.
transaction
do
super
end
end
def
initialize
(
klass
,
attributes
)
super
...
...
lib/gitlab/import_export/project/object_builder.rb
View file @
30ef440f
...
...
@@ -13,14 +13,6 @@ module Gitlab
#
# It also adds some logic around Group Labels/Milestones for edge cases.
class
ObjectBuilder
<
Base
::
ObjectBuilder
def
self
.
build
(
*
args
)
::
Gitlab
::
Database
::
QueryAnalyzers
::
PreventCrossDatabaseModification
.
allow_cross_database_modification_within_transaction
(
url:
'https://gitlab.com/gitlab-org/gitlab/-/issues/350091'
)
do
::
Project
.
transaction
do
super
end
end
end
def
initialize
(
klass
,
attributes
)
super
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment