Skip to content

Commit

Permalink
PR feedback and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mullermp committed Nov 20, 2024
1 parent 9e59677 commit 51f2041
Show file tree
Hide file tree
Showing 23 changed files with 8 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/aws/rails/middleware/elastic_beanstalk_sqsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _execute_periodic_task(job_name)
job.perform_now
rescue NameError => e
@logger.error("Periodic task #{job_name} could not resolve to an Active Job class " \
'- check the spelling in cron.yaml.')
'- check the cron name spelling and set the path as / in cron.yaml.')
@logger.error("Error: #{e}.")
raise e
end
Expand Down
2 changes: 1 addition & 1 deletion lib/aws/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Railtie < ::Rails::Railtie
end

# Register a middleware that will handle requests from the Elastic Beanstalk worker SQS Daemon.
initializer 'aws-sdk-rails.add-sqsd-middleware', after: :build_middleware_stack do |app|
initializer 'aws-sdk-rails.add-sqsd-middleware', before: :build_middleware_stack do |app|
Aws::Rails.add_sqsd_middleware(app)
end
end
Expand Down
6 changes: 2 additions & 4 deletions sample-app/Gemfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
source "https://rubygems.org"

# Our gems
gem 'aws-sdk-rails',
# path: '../'
git: 'https://github.com/aws/aws-sdk-rails', branch: '4.2'

# bundle config set local.aws-sdk-rails ../
gem 'aws-sdk-rails', git: 'https://github.com/aws/aws-sdk-rails', branch: '5.0'
gem 'aws-actiondispatch-dynamodb' #, git: 'https://github.com/aws/aws-actiondispatch-dynamodb-ruby'
gem 'aws-actionmailbox-ses' #, git: 'https://github.com/aws/aws-actionmailbox-ses-ruby'
gem 'aws-actionmailer-ses' #, git: 'https://github.com/aws/aws-actionmailer-ses-ruby'
Expand Down
4 changes: 1 addition & 3 deletions sample-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ Inspect the output of `Aws.config` and ensure the credentials are set.

### Setup

This is configured in `config/initializers/instrument_aws_sdk.rb`. See the `aws-sdk-rails` README.

`UsersController#index` captures any AWS SDK notification with:
This is configured in `config/initializers/notifications.rb`. See the `aws-sdk-rails` README.

```ruby
ActiveSupport::Notifications.subscribe(/[.]aws/) do |name, start, finish, id, _payload|
Expand Down
3 changes: 0 additions & 3 deletions sample-app/app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ class UsersController < ApplicationController

# GET /users
def index
ActiveSupport::Notifications.subscribe(/[.]aws/) do |name, start, finish, id, _payload|
Rails.logger.info "Got notification: #{name} #{start} #{finish} #{id}"
end
@users = User.all
end

Expand Down
1 change: 0 additions & 1 deletion sample-app/config/initializers/instrument_aws_sdk.rb

This file was deleted.

3 changes: 3 additions & 0 deletions sample-app/config/initializers/notifications.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ActiveSupport::Notifications.subscribe(/[.]aws/) do |name, start, finish, id, _payload|
Rails.logger.info "Got notification: #{name} #{start} #{finish} #{id}\n"
end

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 51f2041

Please sign in to comment.