Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better log levels in the message publisher #343

Merged
merged 2 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/hutch/broker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def bindings

filtered = api_client.bindings.
reject { |b| b['destination'] == b['routing_key'] }.
filter { |b| b['source'] == @config[:mq_exchange] && b['vhost'] == @config[:mq_vhost] }
select { |b| b['source'] == @config[:mq_exchange] && b['vhost'] == @config[:mq_vhost] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this change relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes build failures for older ruby versions, see travis builds: https://travis-ci.org/gocardless/hutch/jobs/652451121?utm_medium=notification&utm_source=github_status

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Understood, thanks.


filtered.each do |binding|
results[binding['destination']] << binding['routing_key']
Expand All @@ -197,7 +197,7 @@ def bindings
def unbind_redundant_bindings(queue, routing_keys)
return unless http_api_use_enabled?

filtered = bindings.filter { |dest, keys| dest == queue.name }
filtered = bindings.select { |dest, keys| dest == queue.name }
filtered.each do |dest, keys|
keys.reject { |key| routing_keys.include?(key) }.each do |key|
logger.debug "removing redundant binding #{queue.name} <--> #{key}"
Expand Down
2 changes: 1 addition & 1 deletion lib/hutch/publisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def publish(routing_key, message, properties = {}, options = {})
private

def log_publication(serializer, payload, routing_key)
logger.info {
logger.debug {
spec =
if serializer.binary?
"#{payload.bytesize} bytes message"
Expand Down