From 1a4e3cef4860d5b46adf959bbbffb868dcb9a737 Mon Sep 17 00:00:00 2001 From: Dennis Schubert <mail@dennis-schubert.de> Date: Sun, 10 May 2015 02:32:30 +0200 Subject: [PATCH] Mute ActiveRecord::RecordInvalid due to ignores closes #5943 --- Changelog.md | 2 +- app/workers/base.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index a531e0b945..9a2a53faf7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,7 +6,7 @@ * Dropped db/seeds.rb [#5896](https://github.com/diaspora/diaspora/pull/5896) * Drop broken install scripts [#5907](https://github.com/diaspora/diaspora/pull/5907) * Improve invoking mobile site in the testsuite [#5915](https://github.com/diaspora/diaspora/pull/5915) -* Do not retry a couple of unrecoverable job failures [#5938](https://github.com/diaspora/diaspora/pull/5938) +* Do not retry a couple of unrecoverable job failures [#5938](https://github.com/diaspora/diaspora/pull/5938) [#5942](https://github.com/diaspora/diaspora/pull/5943) ## Bug fixes * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) diff --git a/app/workers/base.rb b/app/workers/base.rb index 25ceadaa35..9165da7a95 100644 --- a/app/workers/base.rb +++ b/app/workers/base.rb @@ -21,7 +21,10 @@ module Workers 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/) + raise e unless %w( + "already been taken" + "is ignored by the post author" + ).any? {|reason| e.message.include? reason } rescue ActiveRecord::RecordNotUnique => e Rails.logger.info("failed to save received object: #{e.message}") raise e unless %w( -- GitLab