Revert to delayed_job from sneakers

pull/527/head
Rick Carlino 2017-11-06 10:04:47 -06:00
parent 5649d107cd
commit 1c07b06daa
5 changed files with 7 additions and 29 deletions

View File

@ -25,7 +25,6 @@ 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,12 +60,9 @@ 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)
@ -231,9 +228,6 @@ 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)
@ -241,11 +235,6 @@ 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)
@ -304,7 +293,6 @@ DEPENDENCIES
simplecov
skylight (= 1.4.0)
smarf_doc!
sneakers
thin
tzinfo
webpack-rails
@ -313,4 +301,4 @@ RUBY VERSION
ruby 2.4.2p198
BUNDLED WITH
1.16.0.pre.3
1.16.0

View File

@ -4,9 +4,7 @@ class AutoSyncJob < ApplicationJob
def perform(broadcast_payload, id, channel, created_at_utc_integer)
wayback = Time.at(created_at_utc_integer).utc
mins = ((wayback - Time.now.utc) / 1.minute).round
host1 = Transport.connection.host
host2 = Transport::AMQP_URL
Rollbar.info("Investigating bad URL", { host1: host1, host2: host2 })
Transport.amqp_send(broadcast_payload, id, channel) if (mins < 2)
end
end

View File

@ -40,11 +40,9 @@ class ApplicationRecord < ActiveRecord::Base
end
def broadcast!
puts "`broadcast!` is stubbed"
# AutoSyncJob.perform_later({}, 2, "sync.Device.3", Time.now.utc.to_i)
# AutoSyncJob.perform_later(broadcast_payload,
# Device.current.id,
# chan_name,
# Time.now.utc.to_i)
AutoSyncJob.perform_later(broadcast_payload,
Device.current.id,
chan_name,
Time.now.utc.to_i)
end
end

View File

@ -8,7 +8,7 @@ Bundler.require(:default, Rails.env)
module FarmBot
class Application < Rails::Application
config.active_job.queue_adapter = :sneakers
config.active_job.queue_adapter = :delayed_job
config.action_dispatch.perform_deep_munge = false
I18n.enforce_available_locales = false
config.generators do |g|
@ -34,10 +34,5 @@ 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