Use AMQP for delayed jobs

pull/527/head
Rick Carlino 2017-10-24 14:33:38 -05:00
parent 3bb0124d93
commit 39e3cdda9a
3 changed files with 20 additions and 2 deletions

View File

@ -25,6 +25,7 @@ gem "webpack-rails"
# vars if you wish to use them on your own servers.
gem "rollbar"
gem "skylight", "1.4.0"
gem "sneakers"
group :development, :test do
gem "codecov", require: false

View File

@ -60,9 +60,12 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
amq-protocol (2.2.0)
arel (8.0.0)
bcrypt (3.1.11)
builder (3.2.3)
bunny (2.7.1)
amq-protocol (>= 2.2.0)
case_transform (0.2)
activesupport
choice (0.2.0)
@ -228,6 +231,9 @@ GEM
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
ruby-graphviz (1.2.3)
serverengine (1.5.11)
sigdump (~> 0.2.2)
sigdump (0.2.4)
simplecov (0.15.1)
docile (~> 1.1.0)
json (>= 1.8, < 3)
@ -235,6 +241,11 @@ GEM
simplecov-html (0.10.2)
skylight (1.4.0)
activesupport (>= 3.0.0)
sneakers (2.6.0)
bunny (~> 2.7.0)
concurrent-ruby (~> 1.0)
serverengine (~> 1.5.11)
thor
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@ -293,6 +304,7 @@ DEPENDENCIES
simplecov
skylight (= 1.4.0)
smarf_doc!
sneakers
thin
tzinfo
webpack-rails
@ -301,4 +313,4 @@ RUBY VERSION
ruby 2.4.2p198
BUNDLED WITH
1.15.4
1.16.0.pre.3

View File

@ -8,7 +8,7 @@ Bundler.require(:default, Rails.env)
module FarmBot
class Application < Rails::Application
config.active_job.queue_adapter = :delayed_job
config.active_job.queue_adapter = :sneakers
config.action_dispatch.perform_deep_munge = false
I18n.enforce_available_locales = false
config.generators do |g|
@ -34,5 +34,10 @@ module FarmBot
Rails.application.routes.default_url_options[:port] = ENV["API_PORT"] || 3000
# ¯\_(ツ)_/¯
$API_URL = "//#{ Rails.application.routes.default_url_options[:host] }:#{ Rails.application.routes.default_url_options[:port] }"
Sneakers.configure(amqp: 'amqp://localhost',
vhost: '/',
exchange: 'sneakers',
exchange_type: :direct)
end
end