diff options
author | Andreas Brandl <abrandl@gitlab.com> | 2018-03-06 12:45:28 +0100 |
---|---|---|
committer | Andreas Brandl <abrandl@gitlab.com> | 2018-03-06 12:53:15 +0100 |
commit | 9f7767079ef061e8ddce32976b1e4a5bef1822d7 (patch) | |
tree | 78b8d71c7351799edc0825abbcf32916b3de09c2 | |
parent | 8e668076a975447a662bf8927388ce55f7d22dba (diff) | |
download | gitlab-ce-9f7767079ef061e8ddce32976b1e4a5bef1822d7.tar.gz |
Shortcut and return on duplicate record error.43460-track-projects-a-user-contributed-to
-rw-r--r-- | app/models/user_interacted_project.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/user_interacted_project.rb b/app/models/user_interacted_project.rb index 68cb3c01c50..dd55a6acb79 100644 --- a/app/models/user_interacted_project.rb +++ b/app/models/user_interacted_project.rb @@ -30,9 +30,9 @@ class UserInteractedProject < ActiveRecord::Base rescue ActiveRecord::RecordNotUnique # Note, above queries are not atomic and prone # to race conditions (similar like #find_or_create!). - # We retry and make sure the outer transaction (if any) - # is not aborted because of this. - retry + # In the case where we hit this, the record we want + # already exists - shortcut and return. + true end end end |