-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Fail fast on bad URL #413
Fail fast on bad URL #413
Conversation
Man! |
6029cef
to
bd3d591
Compare
lib/shoryuken/queue.rb
Outdated
name_or_url.start_with?('https://sqs.') ? set_url(name_or_url) : set_name(name_or_url) | ||
queue_url_params = parse_queue_url_params(name_or_url) | ||
self.name = queue_url_params[:queue_name] | ||
self.url = client.get_queue_url(queue_url_params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maschwenk WDYT about something like this for saving a request, since we need to check fifo?
anyway, and we don't have to assume URL convention for queues: *_, account_id, queue_name = URI.parse(name_or_url).path.split('/')
?
Do you mind also adding a test case queue_spec
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! forgot you need to check fifo?
at some point anyway. Will take a look
Basically just copy-pasted what you had there, changed the names to |
@maschwenk looks good. I added a test and merged into master! 🍻 |
Closes #412
get_queue_url
allows you to optionally specify the account_id of the queue, so this basically programmatically verifies that the queue is correct and verifies that the correct permissions are in place to use the URL in the first place.http://docs.aws.amazon.com/sdkforruby/api/Aws/SQS/Client.html#get_queue_url