Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [1.9.8]

- Improve performance by reusing SNS client

## [1.9.7]

- Fix undefined method 'set_data' for nil span in Sentry integration
Expand Down
29 changes: 13 additions & 16 deletions lib/eventboss/sns_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,22 @@ def set_raw_message_delivery(subscription)
end

def backend
if configured?
options = {
region: configuration.eventboss_region,
}
@backend ||=
if configured?
options = {
region: configuration.eventboss_region
}

unless configuration.eventboss_use_default_credentials
options[:credentials] = credentials
end
options[:credentials] = credentials unless configuration.eventboss_use_default_credentials

if configuration.aws_sns_endpoint
options[:endpoint] = configuration.aws_sns_endpoint
end
options[:endpoint] = configuration.aws_sns_endpoint if configuration.aws_sns_endpoint

Aws::SNS::Client.new(options)
elsif configuration.raise_on_missing_configuration
raise NotConfigured, 'Eventboss is not configured.'
else
Mock.new
end
Aws::SNS::Client.new(options)
elsif configuration.raise_on_missing_configuration
raise NotConfigured, 'Eventboss is not configured.'
else
Mock.new
end
end

def credentials
Expand Down
2 changes: 1 addition & 1 deletion lib/eventboss/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Eventboss
VERSION = "1.9.7"
VERSION = "1.9.8"
end