Skip to content

Commit

Permalink
Verify connection on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
alanbrent committed Oct 24, 2024
1 parent 0d7d289 commit 7c2c181
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/chore/queues/sqs/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@ class Consumer < Chore::Consumer
# @param [Hash] opts Options
def initialize(queue_name, opts={})
super(queue_name, opts)
verify_connection
raise Chore::TerribleMistake, "Cannot specify a queue polling size greater than 10" if sqs_polling_amount > 10
end

def verify_connection
queue
end

# Resets the API client connection and provides @@reset_at so we know when the last time that was done
def self.reset_connection!
@@reset_at = Time.now
Expand Down
2 changes: 1 addition & 1 deletion lib/chore/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Chore
module Version #:nodoc:
MAJOR = 4
MINOR = 6
PATCH = 0
PATCH = 1

STRING = [ MAJOR, MINOR, PATCH ].join('.')
end
Expand Down

0 comments on commit 7c2c181

Please sign in to comment.