aws-sdk-rails 3.6.2 → 3.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6dcc9e1a5e3c78d6952327013a71e7e1b2516025c9191eafde4751154854b494
4
- data.tar.gz: 51eb886b4149c80f585b2ee358a14def1f4c96ab08da36545330518b47442eb5
3
+ metadata.gz: 02dc930917c099420e224d5193b65a406ed2b8fa5f7a082515f692e99c06f421
4
+ data.tar.gz: b37670c127021772d0f2e76b4ac3a0ce4a0b35c112c1f9eed21b8c30ca981b00
5
5
  SHA512:
6
- metadata.gz: 6b2a91990771c25123f531e82dc4bc67d6c27c6866ccc219b765eefc38181321f5871f9b9f23189bf8a603a513756e25eb70a47f76858f59a8762798f44e301a
7
- data.tar.gz: a336bdcd1e91d0b21df76f8fde5382d1792491e611be00804ac2f03a1a64eaa656295ab6e13675201d79aeb710f91bff955dcbd7b846faeb884dbbd2e64e15c4
6
+ metadata.gz: 496f7fe7c27beebd9cd99e5eac7e785ba197cf8913bc28bc60511192fb32caf7b9fa6caa088a0ea75eae7824a468256688d3060f8176efd0c1fa2962611c06a9
7
+ data.tar.gz: 366e891aea46c737de15b2b58b5b593a980a277b0c2c20c87e28b8b9be446ce5a906e3f1f445bbcf0a63cc8332702d851d97d90c9db31c45fbc82e07d3186a67
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.6.2
1
+ 3.6.3
@@ -11,16 +11,16 @@ module ActiveJob
11
11
  _enqueue(job)
12
12
  end
13
13
 
14
- def enqueue_at(job, timestamp, opts={})
14
+ def enqueue_at(job, timestamp)
15
15
  delay = (timestamp - Time.now.to_f).floor
16
16
  raise ArgumentError, 'Unable to queue a job with a delay great than 15 minutes' if delay > 15.minutes
17
- _enqueue(job, delay_seconds: delay)
17
+ _enqueue(job, nil, delay_seconds: delay)
18
18
  end
19
19
 
20
20
  private
21
21
 
22
- def _enqueue(job, send_message_opts = {})
23
- body = job.serialize
22
+ def _enqueue(job, body = nil, send_message_opts = {})
23
+ body ||= job.serialize
24
24
  queue_url = Aws::Rails::SqsActiveJob.config.queue_url_for(job.queue_name)
25
25
  send_message_opts[:queue_url] = queue_url
26
26
  send_message_opts[:message_body] = Aws::Json.dump(body)
@@ -18,19 +18,22 @@ module ActiveJob
18
18
 
19
19
  private
20
20
 
21
- def _enqueue(job, send_message_opts = {})
21
+ def _enqueue(job, body = nil, send_message_opts = {})
22
22
  # FIFO jobs must be queued in order, so do not queue async
23
23
  queue_url = Aws::Rails::SqsActiveJob.config.queue_url_for(job.queue_name)
24
24
  if Aws::Rails::SqsActiveJob.fifo?(queue_url)
25
- super(job, send_message_opts)
25
+ super(job, body, send_message_opts)
26
26
  else
27
- Concurrent::Promise
28
- .execute { super(job, send_message_opts) }
29
- .on_error do |e|
30
- Rails.logger.error "Failed to queue job #{job}. Reason: #{e}"
31
- error_handler = Aws::Rails::SqsActiveJob.config.async_queue_error_handler
32
- error_handler.call(e, job, send_message_opts) if error_handler
33
- end
27
+ # Serialize is called here because the job’s locale needs to be
28
+ # determined in this thread and not in some other thread.
29
+ body = job.serialize
30
+ Concurrent::Promises
31
+ .future { super(job, body, send_message_opts) }
32
+ .rescue do |e|
33
+ Rails.logger.error "Failed to queue job #{job}. Reason: #{e}"
34
+ error_handler = Aws::Rails::SqsActiveJob.config.async_queue_error_handler
35
+ error_handler&.call(e, job, send_message_opts)
36
+ end
34
37
  end
35
38
  end
36
39
  end
@@ -26,7 +26,6 @@ module Aws
26
26
  # @api private
27
27
  DEFAULTS = {
28
28
  max_messages: 10,
29
- visibility_timeout: 120,
30
29
  shutdown_timeout: 15,
31
30
  queues: {},
32
31
  logger: ::Rails.logger,
@@ -50,6 +49,8 @@ module Aws
50
49
  # The max number of messages to poll for in a batch.
51
50
  #
52
51
  # @option options [Integer] :visibility_timeout
52
+ # If unset, the visibility timeout configured on the
53
+ # SQS queue will be used.
53
54
  # The visibility timeout is the number of seconds
54
55
  # that a message will not be processable by any other consumers.
55
56
  # You should set this value to be longer than your expected job runtime
@@ -99,7 +100,7 @@ module Aws
99
100
  job_queue = job_queue.to_sym
100
101
  raise ArgumentError, "No queue defined for #{job_queue}" unless queues.key? job_queue
101
102
 
102
- queues[job_queue.to_sym]
103
+ queues[job_queue]
103
104
  end
104
105
 
105
106
  # @api private
@@ -17,7 +17,6 @@ module Aws
17
17
  DEFAULT_OPTS = {
18
18
  threads: 2*Concurrent.processor_count,
19
19
  max_messages: 10,
20
- visibility_timeout: 60,
21
20
  shutdown_timeout: 15,
22
21
  backpressure: 10
23
22
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.2
4
+ version: 3.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-16 00:00:00.000000000 Z
11
+ date: 2022-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-record
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.2.7
167
+ rubygems_version: 3.2.26
168
168
  signing_key:
169
169
  specification_version: 4
170
170
  summary: AWS SDK for Ruby on Rails Plugin