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
5c45c21d
Commit
5c45c21d
authored
Dec 07, 2018
by
Nick Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix transaction pollution in Shard.by_name
parent
9ed1c2b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
app/models/shard.rb
app/models/shard.rb
+3
-1
No files found.
app/models/shard.rb
View file @
5c45c21d
...
@@ -18,7 +18,9 @@ class Shard < ActiveRecord::Base
...
@@ -18,7 +18,9 @@ class Shard < ActiveRecord::Base
end
end
def
self
.
by_name
(
name
)
def
self
.
by_name
(
name
)
transaction
(
requires_new:
true
)
do
find_or_create_by
(
name:
name
)
find_or_create_by
(
name:
name
)
end
rescue
ActiveRecord
::
RecordNotUnique
rescue
ActiveRecord
::
RecordNotUnique
retry
retry
end
end
...
...
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