active_elastic_job 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98e8fc2ff4cbd08606241083c7e3ceccd8108108
|
4
|
+
data.tar.gz: f55ec5c86259ab8c9439afab8692e0b546a71114
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9896471a6018a88efe19c55508c748456aabb3d84656adf710915323a0c19e86b776df934874cfdeee5a2f3ec4e2a68360b7c6c7a171d6ad64a12ef42b6baee9
|
7
|
+
data.tar.gz: a14cb288a8c2392b6fafe0506c9355bf51d009097e8362de28bd761951c621b71716faf043b6a6c405d0813363410e9399e80b1dc3db9652c28f4efa32627bf6
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module ActiveElasticJob
|
2
2
|
class Railtie < Rails::Railtie
|
3
3
|
config.active_elastic_job = ActiveSupport::OrderedOptions.new
|
4
|
-
config.active_elastic_job.process_jobs = ENV['PROCESS_ACTIVE_ELASTIC_JOBS'] == 'true'
|
5
|
-
config.active_elastic_job.aws_credentials = Aws::InstanceProfileCredentials.new
|
4
|
+
config.active_elastic_job.process_jobs = ENV['PROCESS_ACTIVE_ELASTIC_JOBS'] == 'true'
|
5
|
+
config.active_elastic_job.aws_credentials = lambda { Aws::InstanceProfileCredentials.new }
|
6
6
|
config.active_elastic_job.periodic_tasks_route = '/periodic_tasks'.freeze
|
7
7
|
|
8
8
|
initializer "active_elastic_job.insert_middleware" do |app|
|
@@ -27,7 +27,6 @@ module ActiveJob
|
|
27
27
|
# imposed by Amazon SQS.
|
28
28
|
class SerializedJobTooBig < Error
|
29
29
|
def initialize(serialized_job)
|
30
|
-
msg = <<-MSG
|
31
30
|
super(<<-MSG)
|
32
31
|
The job contains #{serialized_job.bytesize} bytes in its serialzed form,
|
33
32
|
which exceeds the allowed maximum of #{MAX_MESSAGE_SIZE} bytes imposed by Amazon SQS.
|
@@ -142,7 +141,7 @@ module ActiveJob
|
|
142
141
|
resp = aws_sqs_client.get_queue_url(queue_name: queue_name.to_s)
|
143
142
|
@queue_urls[cache_key] = resp.queue_url
|
144
143
|
rescue Aws::SQS::Errors::NonExistentQueue => e
|
145
|
-
raise NonExistentQueue,
|
144
|
+
raise NonExistentQueue.new(queue_name, aws_region)
|
146
145
|
end
|
147
146
|
|
148
147
|
def calculate_delay(timestamp)
|
@@ -170,7 +169,11 @@ module ActiveJob
|
|
170
169
|
end
|
171
170
|
|
172
171
|
def aws_sqs_client_credentials
|
173
|
-
config.aws_credentials
|
172
|
+
@aws_credentials ||= if config.aws_credentials.kind_of?(Proc)
|
173
|
+
config.aws_credentials.call
|
174
|
+
else
|
175
|
+
config.aws_credentials
|
176
|
+
end
|
174
177
|
end
|
175
178
|
|
176
179
|
def aws_region
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_elastic_job
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tawan Sierek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|