use obj_str for logging
This commit is contained in:
parent
8ff3062c68
commit
2d4f9a60d5
2 changed files with 10 additions and 10 deletions
|
|
@ -5,12 +5,12 @@ module DiasporaFederation
|
|||
# Send a public message to all urls
|
||||
#
|
||||
# @param [String] sender_id sender diaspora-ID
|
||||
# @param [String] guid guid of the object to send (can be nil if the object has no guid)
|
||||
# @param [String] obj_str object string representation for logging (e.g. type@guid)
|
||||
# @param [Array<String>] urls receive-urls from pods
|
||||
# @param [String] xml salmon-xml
|
||||
# @return [Array<String>] url to retry
|
||||
def self.public(sender_id, guid, urls, xml)
|
||||
hydra = HydraWrapper.new(sender_id, guid)
|
||||
def self.public(sender_id, obj_str, urls, xml)
|
||||
hydra = HydraWrapper.new(sender_id, obj_str)
|
||||
urls.each {|url| hydra.insert_job(url, xml) }
|
||||
hydra.send
|
||||
end
|
||||
|
|
@ -18,11 +18,11 @@ module DiasporaFederation
|
|||
# Send a private message to receive-urls
|
||||
#
|
||||
# @param [String] sender_id sender diaspora-ID
|
||||
# @param [String] guid guid of the object to send (can be nil if the object has no guid)
|
||||
# @param [String] obj_str object string representation for logging (e.g. type@guid)
|
||||
# @param [Hash] targets Hash with receive-urls (key) of peoples with encrypted salmon-xml for them (value)
|
||||
# @return [Hash] targets to retry
|
||||
def self.private(sender_id, guid, targets)
|
||||
hydra = HydraWrapper.new(sender_id, guid)
|
||||
def self.private(sender_id, obj_str, targets)
|
||||
hydra = HydraWrapper.new(sender_id, obj_str)
|
||||
targets.each {|url, xml| hydra.insert_job(url, xml) }
|
||||
Hash[hydra.send.map {|url| [url, targets[url]] }]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ module DiasporaFederation
|
|||
# Create a new instance for a message
|
||||
#
|
||||
# @param [String] sender_id sender diaspora-ID
|
||||
# @param [String] guid guid of the object to send (can be nil if the object has no guid)
|
||||
def initialize(sender_id, guid)
|
||||
# @param [String] obj_str object string representation for logging (e.g. type@guid)
|
||||
def initialize(sender_id, obj_str)
|
||||
@sender_id = sender_id
|
||||
@guid = guid
|
||||
@obj_str = obj_str
|
||||
@urls_to_retry = []
|
||||
end
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ module DiasporaFederation
|
|||
success = response.success?
|
||||
DiasporaFederation.callbacks.trigger(:update_pod, pod_url(response.effective_url), success)
|
||||
|
||||
log_line = "success=#{success} sender=#{@sender_id} guid=#{@guid} url=#{response.effective_url} " \
|
||||
log_line = "success=#{success} sender=#{@sender_id} obj=#{@obj_str} url=#{response.effective_url} " \
|
||||
"message=#{response.return_code} code=#{response.response_code} time=#{response.total_time}"
|
||||
if success
|
||||
logger.info(log_line)
|
||||
|
|
|
|||
Loading…
Reference in a new issue