Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Schubert <mail@dennis-schubert.de>2015-05-08 01:49:29 +0300
committerJonne Haß <me@jhass.eu>2015-05-10 01:09:25 +0300
commit915dee3c4b9ec0b3f8413cf00b8251116143e3fd (patch)
tree0027f13e6c42671ea0e588e94f41cd9b13f35993 /app/workers
parent05ec235ea32cc8e30673ddb3d5521c104895418c (diff)
Mute some ActiveRecord::RecordNotUnique exceptions
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/base.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/workers/base.rb b/app/workers/base.rb
index c43f60929..7fb53f548 100644
--- a/app/workers/base.rb
+++ b/app/workers/base.rb
@@ -13,12 +13,22 @@ module Workers
yield
rescue Diaspora::ContactRequiredUnlessRequest,
Diaspora::RelayableObjectWithoutParent,
- # Friendica seems to provoke these
+ # Friendica seems to provoke these
Diaspora::AuthorXMLAuthorMismatch => e
Rails.logger.info("error on receive: #{e.class}")
rescue ActiveRecord::RecordInvalid => e
Rails.logger.info("failed to save received object: #{e.record.errors.full_messages}")
raise e unless e.message.match(/already been taken/)
+ rescue ActiveRecord::RecordNotUnique => e
+ Rails.logger.info("failed to save received object: #{e.record.errors.full_messages}")
+ raise e unless %w(
+ index_comments_on_guid
+ index_likes_on_guid
+ index_posts_on_guid
+ "duplicate key in table 'comments'"
+ "duplicate key in table 'likes'"
+ "duplicate key in table 'posts'"
+ ).any? {|index| e.message.include? index }
end
end
end