Skip to content

Commit

Permalink
Do not add middleware at all if disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tawan committed Mar 6, 2016
1 parent 0df28d1 commit 2bfb7a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/active_elastic_job/railtie.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
module ActiveElasticJob
class Railtie < Rails::Railtie
initializer "active_elastic_job.insert_middleware" do |app|
app.config.middleware.use "ActiveElasticJob::Rack::SqsMessageConsumer"
disabled = ENV['DISABLE_SQS_CONSUMER']
if disabled == 'false' || disabled.nil?
app.config.middleware.use "ActiveElasticJob::Rack::SqsMessageConsumer"
end
end
end
end

0 comments on commit 2bfb7a3

Please sign in to comment.