class Q::Methods::Sidekiq::QueueTask
Public Class Methods
-c, –concurrency INT processor threads to use -d, –daemon Daemonize process -e, –environment ENV Application environment -g, –tag TAG Process tag for procline -i, –index INT unique process index on this machine -p, –profile Profile all code run by Sidekiq
-q, –queue QUEUE… Queues to process with optional weights -r, –require [PATH|DIR] Location of Rails application with workers or file to require -t, –timeout NUM Shutdown timeout -v, –verbose Print more verbose output -C, –config PATH path to YAML config file -L, –logfile PATH path to writable logfile -P, –pidfile PATH path to pidfile -V, –version Print version and exit -h, –help Show help
# File lib/q/methods/sidekiq.rb, line 49 def self.call(*args) setup! cmd = "bundle exec sidekiq " cmd << ENV["QUEUE"] if ENV["QUEUE"] cmd << args.join(" ") if args.any? puts cmd.inspect exec cmd end
# File lib/q/methods/sidekiq.rb, line 58 def self.setup! return unless database_url = ENV['DATABASE_URL'] Sidekiq.configure_server do |config| ENV['DATABASE_URL'] = "#{database_url}?pool=25" ActiveRecord::Base.establish_connection end end