diff --git a/lib/sidekiq/cli.rb b/lib/sidekiq/cli.rb index c963691d..98a0df4d 100644 --- a/lib/sidekiq/cli.rb +++ b/lib/sidekiq/cli.rb @@ -49,7 +49,6 @@ require 'erb' require 'sidekiq' require 'sidekiq/util' -require 'sidekiq/launcher' module Sidekiq class CLI @@ -90,6 +89,7 @@ module Sidekiq logger.info 'Starting processing, hit Ctrl-C to stop' end + require 'sidekiq/launcher' @launcher = Sidekiq::Launcher.new(options) launcher.procline(options[:tag] ? "#{options[:tag]} " : '') @@ -121,6 +121,8 @@ module Sidekiq private def load_celluloid + raise "Celluloid cannot be required until here, or it will break Sidekiq's daemonization" if defined?(::Celluloid) + # Celluloid can't be loaded until after we've daemonized # because it spins up threads and creates locks which get # into a very bad state if forked. diff --git a/lib/sidekiq/launcher.rb b/lib/sidekiq/launcher.rb index d152994b..ce2cad5e 100644 --- a/lib/sidekiq/launcher.rb +++ b/lib/sidekiq/launcher.rb @@ -1,4 +1,3 @@ - require 'sidekiq/util' require 'sidekiq/manager' require 'sidekiq/scheduled'