lib/rocket_job/cli.rb in rocketjob-3.4.0 vs lib/rocket_job/cli.rb in rocketjob-3.4.1

- old
+ new

@@ -1,9 +1,10 @@ require 'optparse' require 'semantic_logger' require 'mongoid' require 'rocketjob' +require 'rocket_job/extensions/mongoid/factory' module RocketJob # Command Line Interface parser for RocketJob class CLI include SemanticLogger::Loggable attr_accessor :name, :workers, :environment, :pidfile, :directory, :quiet, @@ -33,11 +34,11 @@ setup_logger rails? ? boot_rails : boot_standalone write_pidfile # In case Rails did not load the Mongoid Config - RocketJob::Config.load!(environment, mongo_config, symmetric_encryption_config) if Mongoid::Config.clients.empty? + RocketJob::Config.load!(environment, mongo_config, symmetric_encryption_config) if ::Mongoid::Config.clients.empty? opts = {} opts[:name] = name if name opts[:max_workers] = workers if workers opts[:filter] = {:_type => filter} if filter @@ -130,11 +131,11 @@ SemanticLogger.default_level = log_level.to_sym if log_level # Enable SemanticLogger signal handling for this process SemanticLogger.add_signal_handler - Mongoid.logger = SemanticLogger[Mongoid] - Mongo::Logger.logger = SemanticLogger[Mongo] + ::Mongoid.logger = SemanticLogger[::Mongoid] + ::Mongo::Logger.logger = SemanticLogger[::Mongo] end # Eager load files in jobs folder def self.eager_load_jobs(path = 'jobs') Pathname.glob("#{path}/**/*.rb").each do |path|