diff --git a/app/models/jobs/base.rb b/app/models/jobs/base.rb index 69b9ea856..f947e7c0a 100644 --- a/app/models/jobs/base.rb +++ b/app/models/jobs/base.rb @@ -15,8 +15,10 @@ module Jobs begin yield rescue Exception => e - FEDERATION_LOGGER.info(e.message) - raise e + Rails.info("error in job: #{e.message}") + unless DUMB_ERROR_MESSAGES.include?(e.message) + raise e + end end end end diff --git a/config/environments/integration_1.rb b/config/environments/integration_1.rb deleted file mode 100644 index 042a23caa..000000000 --- a/config/environments/integration_1.rb +++ /dev/null @@ -1,39 +0,0 @@ - # Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -Diaspora::Application.configure do - # Settings specified here will take precedence over those in config/environment.rb - - # In the development environment your application's code is reloaded on - # every request. This slows down response time but is perfect for development - # since you don't have to restart the webserver when you make code changes. - config.cache_classes = false - - # Log error messages when you accidentally call methods on nil. - config.whiny_nils = true - - # Show full error reports and disable caching - config.consider_all_requests_local = true - config.action_controller.perform_caching = false - - # Don't care if the mailer can't send - config.action_mailer.raise_delivery_errors = false - config.active_support.deprecation = :log - - config.threadsafe! - - # Monkeypatch around the nasty "2.5MB exception page" issue, caused by very large environment vars - # This snippet via: http://stackoverflow.com/questions/3114993/exception-pages-in-development-mode-take-upwards-of-15-30-seconds-to-render-why - # Relevant Rails ticket: https://rails.lighthouseapp.com/projects/8994/tickets/5027-_request_and_responseerb-and-diagnosticserb-take-an-increasingly-long-time-to-render-in-development-with-multiple-show-tables-calls - config.after_initialize do - module SmallInspect - def inspect - "<#{self.class.name} - tooooo long>" - end - end - [ActionController::Base, ActionDispatch::RemoteIp::RemoteIpGetter, OmniAuth::Strategy, Warden::Proxy].each do |klazz| - klazz.send(:include, SmallInspect) - end - end -end diff --git a/lib/postzord/receiver/local_batch.rb b/lib/postzord/receiver/local_batch.rb index 45f0af1c0..f7bc5811f 100644 --- a/lib/postzord/receiver/local_batch.rb +++ b/lib/postzord/receiver/local_batch.rb @@ -14,7 +14,7 @@ class Postzord::Receiver::LocalBatch < Postzord::Receiver end def receive! - FEDERATION_LOGGER.info("receiving local batch for #{@object.class}:#{@object.guid}") + FEDERATION_LOGGER.info("receiving local batch for #{@object.inspect}") if @object.respond_to?(:relayable?) receive_relayable else @@ -25,7 +25,7 @@ class Postzord::Receiver::LocalBatch < Postzord::Receiver # 09/27/11 this is slow notify_users - FEDERATION_LOGGER.info("receiving local batch completed for #{@object.class}:#{@object.guid}") + FEDERATION_LOGGER.info("receiving local batch completed for #{@object.inspect}") true end diff --git a/lib/postzord/receiver/private.rb b/lib/postzord/receiver/private.rb index 8b1851408..3f2b97b69 100644 --- a/lib/postzord/receiver/private.rb +++ b/lib/postzord/receiver/private.rb @@ -28,7 +28,7 @@ class Postzord::Receiver::Private < Postzord::Receiver end rescue Exception => e #this sucks - FEDERATION_LOGGER.info("Failure to receive #{@object.class}:#{@object.id} for sender:#{@sender.id} for user:#{@user.id}: #{e.message}") + FEDERATION_LOGGER.info("Failure to receive #{@object.inspect} for sender:#{@sender.id} for user:#{@user.id}: #{e.message}") raise e end end @@ -53,7 +53,7 @@ class Postzord::Receiver::Private < Postzord::Receiver def receive_object obj = @object.receive(@user, @author) Notification.notify(@user, obj, @author) if obj.respond_to?(:notification_type) - FEDERATION_LOGGER.info("user:#{@user.id} successfully received private post from person#{@sender.guid} #{@object.class}:#{@object.guid}") + FEDERATION_LOGGER.info("user:#{@user.id} successfully received private post from person#{@sender.guid} #{@object.inspect}") obj end diff --git a/lib/postzord/receiver/public.rb b/lib/postzord/receiver/public.rb index 2955def04..ac92ca3cd 100644 --- a/lib/postzord/receiver/public.rb +++ b/lib/postzord/receiver/public.rb @@ -20,16 +20,15 @@ class Postzord::Receiver::Public < Postzord::Receiver # @return [void] def receive! - raise 'not valid signature' unless verified_signature? - raise 'unable to save object' unless save_object + return false unless verified_signature? + return false unless save_object - FEDERATION_LOGGER.info("received a #{@object.class}:#{@object.guid} with author #{@object.author.diaspora_handle}") + FEDERATION_LOGGER.info("received a #{@object.inspect}") if @object.respond_to?(:relayable?) receive_relayable elsif @object.is_a?(AccountDeletion) #nothing else - FEDERATION_LOGGER.info("queuing local batchjob") Resque.enqueue(Jobs::ReceiveLocalBatch, @object.class.to_s, @object.id, self.recipient_user_ids) true end diff --git a/lib/webfinger.rb b/lib/webfinger.rb index 6400789e6..180ec2df9 100644 --- a/lib/webfinger.rb +++ b/lib/webfinger.rb @@ -51,7 +51,7 @@ class Webfinger else person = make_person_from_webfinger end - FEDERATION_LOGGER.logger.info("successfully webfingered#{@account}") + FEDERATION_LOGGER.info("successfully webfingered#{@account}") person end