active_elastic_job 1.6.3 → 1.7.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33d8c9fbb99bf26f435b6ec527e34022b1967473
|
4
|
+
data.tar.gz: e87b6fb000e3ee8feac2b549af57b83852358c72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca2572266cbfd44cfa04270ece01d0e99c26f6768ac6d20aa4f7fd3969130ff5afb2d82f11ac3ba092ddf2378dedeada37c344844a677aebf4e73b650ee50cde
|
7
|
+
data.tar.gz: 068c7a6062081d4d0196d4a865179515f89b9a93375aa55574cd6a724c9316295d56a3b277aaf01c9debf882ed337e00741caf6f83e8111517b2bc920b38fa23
|
@@ -1,7 +1,13 @@
|
|
1
1
|
module ActiveElasticJob
|
2
2
|
class Railtie < Rails::Railtie
|
3
|
+
config.active_elastic_job = ActiveSupport::OrderedOptions.new
|
4
|
+
config.active_elastic_job.aws_region = ENV['AWS_REGION']
|
5
|
+
config.active_elastic_job.aws_access_key_id = ENV['AWS_ACCESS_KEY_ID']
|
6
|
+
config.active_elastic_job.aws_secret_access_key = ENV['AWS_SECRET_ACCESS_KEY'] || ENV['AWS_SECRET_KEY'] || ENV['AMAZON_SECRET_ACCESS_KEY']
|
7
|
+
config.active_elastic_job.disable_sqs_confumer = ENV['DISABLE_SQS_CONSUMER']
|
8
|
+
|
3
9
|
initializer "active_elastic_job.insert_middleware" do |app|
|
4
|
-
disabled =
|
10
|
+
disabled = app.config.active_elastic_job.disable_sqs_confumer
|
5
11
|
if disabled == 'false' || disabled.nil?
|
6
12
|
if app.config.force_ssl
|
7
13
|
app.config.middleware.insert_before(ActionDispatch::SSL,ActiveElasticJob::Rack::SqsMessageConsumer)
|
@@ -171,12 +171,17 @@ module ActiveJob
|
|
171
171
|
end
|
172
172
|
|
173
173
|
def aws_sqs_client
|
174
|
-
|
175
|
-
@aws_sqs_client ||=
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
174
|
+
c = Rails.application.config.active_elastic_job
|
175
|
+
@aws_sqs_client ||= if c.aws_credentials.present?
|
176
|
+
Aws::SQS::Client.new(
|
177
|
+
credentials: c.aws_credentials,
|
178
|
+
region: c.aws_region)
|
179
|
+
else
|
180
|
+
Aws::SQS::Client.new(
|
181
|
+
access_key_id: c.aws_access_key_id,
|
182
|
+
secret_access_key: c.aws_secret_access_key,
|
183
|
+
region: c.aws_region)
|
184
|
+
end
|
180
185
|
end
|
181
186
|
|
182
187
|
def message_digest(messsage_body)
|