active_elastic_job 2.0.0 → 2.0.1

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: d8e455f174d4846927c18875dd2e1f645a87f870
4
- data.tar.gz: 3cd316cd0b53a07cbf66234ccbb2ec71f5fe6e61
3
+ metadata.gz: 98e8fc2ff4cbd08606241083c7e3ceccd8108108
4
+ data.tar.gz: f55ec5c86259ab8c9439afab8692e0b546a71114
5
5
  SHA512:
6
- metadata.gz: d7ef1844c86ce29e4a93e0184eca63e879b0d43bcc08d1e35ab7573a08975e6943f8eb489028d4f47960780ab60743cbefc760961dd25b3cf49ed49500a00d9b
7
- data.tar.gz: e0e5d7390144a3ebf53c756dc7a56436e14dabf4a6e2e37765fefff5625568a93669b7c8623b1f3aa1124c148938468e46d9059d59f604d2f85cb89b9d917798
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' || false
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|
@@ -2,7 +2,7 @@ module ActiveElasticJob
2
2
  module VERSION
3
3
  MAJOR = 2
4
4
  MINOR = 0
5
- TINY = 0
5
+ TINY = 1
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -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, queue_name
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.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: 2016-11-27 00:00:00.000000000 Z
11
+ date: 2017-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk