7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/sidekiq/aws/sqs/helpers.rb', line 7
def validate_sqs_options!
raise ArgumentError, 'You must use the `sqs_options` method on your worker' if @sqs_options.blank?
if need_to_raise_for_queue_url?
raise ArgumentError,
'You must provide a SQS queue URL like `sqs_options queue_url: "url"'
end
raise ArgumentError, 'You must provide a SQS client' if need_to_raise_for_client?
if need_to_raise_for_wait_time_seconds?
raise ArgumentError,
'You must provide a valid wait time like `sqs_options wait_time_seconds: 20`'
end
if need_to_raise_for_max_number_of_messages?
raise ArgumentError,
'You must provide a valid max number of messages like `sqs_options max_number_of_messages: 10`'
end
return unless need_to_raise_for_destroy_on_received?
raise ArgumentError,
'You must provide a valid destroy on received like `sqs_options destroy_on_received: true`'
end
|