DG MS move dispatch post to EM::next_tick in controller so the post response returns to the poster much faster. also fixed a bug in the logs refrencing an object that did not exsist

This commit is contained in:
maxwell 2010-11-27 11:12:15 -08:00 committed by danielvincent
parent be463f8f7f
commit 62b4e85b0b
3 changed files with 5 additions and 4 deletions

View file

@ -26,10 +26,10 @@ class StatusMessagesController < ApplicationController
raise 'MongoMapper failed to catch a failed save' unless @status_message.id
@status_message.photos += photos unless photos.nil?
current_user.dispatch_post(@status_message, :to => params[:status_message][:aspect_ids])
EM::next_tick {current_user.dispatch_post(@status_message, :to => params[:status_message][:aspect_ids])}
for photo in photos
current_user.dispatch_post(photo, :to => params[:status_message][:aspect_ids])
EM::next_tick { current_user.dispatch_post(photo, :to => params[:status_message][:aspect_ids])}
end
respond_to do |format|

View file

@ -102,7 +102,7 @@ module Diaspora
def receive_comment comment
unless comment.post.person == self.person || comment.verify_post_creator_signature
Rails.logger.info("event=receive status=abort reason='comment signature not valid' recipient=#{self.diaspora_handle} sender=#{salmon_author.diaspora_handle} payload_type=#{comment.class} post_id=#{comment.post_id}")
Rails.logger.info("event=receive status=abort reason='comment signature not valid' recipient=#{self.diaspora_handle} sender=#{comment.post.person.diaspora_handle} payload_type=#{comment.class} post_id=#{comment.post_id}")
return
end
self.visible_people = self.visible_people | [comment.person]
@ -139,7 +139,7 @@ module Diaspora
end
elsif on_pod == post
update_user_refs_and_add_to_aspects(on_pod)
Rails.logger.info("event=receive payload_type=#{post.class} update=true status=complete sender=#{post.diaspora_handle} existing_post=#{known_post.id}")
Rails.logger.info("event=receive payload_type=#{post.class} update=true status=complete sender=#{post.diaspora_handle} existing_post=#{on_pod.id}")
post
end
elsif !on_pod

View file

@ -98,6 +98,7 @@ class EMWebfinger
c.call(person)
rescue Exception => e
Rails.logger.info("event=EMWebfinger status=error_on_callback error='#{e.inspect}'")
raise e
end
}
Rails.logger.info("event=EMWebfinger status=complete target=#{@account}")