lib/fishplate.rb in fishplate-0.2.2 vs lib/fishplate.rb in fishplate-0.3.0
- old
+ new
@@ -4,10 +4,11 @@
require 'active_support/all'
require 'logger'
require 'fishplate/version'
require 'fishplate/rack'
+require 'fishplate/sidekiq_middleware'
module Fishplate
class << self
def load_seed
return unless A9n.root.join('db/seeds.rb').exist?
@@ -59,8 +60,20 @@
ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.flush_idle_connections!
ActiveRecord::Base.establish_connection
+
+ add_sidekiq_middleware if defined?(Sidekiq)
+ end
+
+ private
+
+ def add_sidekiq_middleware
+ Sidekiq.configure_server do |config|
+ config.server_middleware do |chain|
+ chain.add Fishplate::SidekiqMiddleware
+ end
+ end
end
end
end