mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
minor cleanups and doc fixes for 6.0
This commit is contained in:
parent
e552d4c383
commit
903448a9be
5 changed files with 17 additions and 22 deletions
|
@ -713,7 +713,7 @@ module Sidekiq
|
||||||
|
|
||||||
##
|
##
|
||||||
# Enumerates the set of Sidekiq processes which are actively working
|
# Enumerates the set of Sidekiq processes which are actively working
|
||||||
# right now. Each process send a heartbeat to Redis every 5 seconds
|
# right now. Each process sends a heartbeat to Redis every 5 seconds
|
||||||
# so this set should be relatively accurate, barring network partitions.
|
# so this set should be relatively accurate, barring network partitions.
|
||||||
#
|
#
|
||||||
# Yields a Sidekiq::Process.
|
# Yields a Sidekiq::Process.
|
||||||
|
|
|
@ -56,8 +56,7 @@ module Sidekiq
|
||||||
# touch the connection pool so it is created before we
|
# touch the connection pool so it is created before we
|
||||||
# fire startup and start multithreading.
|
# fire startup and start multithreading.
|
||||||
ver = Sidekiq.redis_info["redis_version"]
|
ver = Sidekiq.redis_info["redis_version"]
|
||||||
raise "You are using Redis v#{ver}, Sidekiq requires Redis v2.8.0 or greater" if ver < "2.8"
|
raise "You are using Redis v#{ver}, Sidekiq requires Redis v4.0.0 or greater" if ver < "4"
|
||||||
logger.warn "Sidekiq 6.0 requires Redis 4.0+, you are using Redis v#{ver}" if ver < "4"
|
|
||||||
|
|
||||||
# Since the user can pass us a connection pool explicitly in the initializer, we
|
# Since the user can pass us a connection pool explicitly in the initializer, we
|
||||||
# need to verify the size is large enough or else Sidekiq's performance is dramatically slowed.
|
# need to verify the size is large enough or else Sidekiq's performance is dramatically slowed.
|
||||||
|
@ -98,9 +97,13 @@ module Sidekiq
|
||||||
rescue Interrupt
|
rescue Interrupt
|
||||||
logger.info "Shutting down"
|
logger.info "Shutting down"
|
||||||
launcher.stop
|
launcher.stop
|
||||||
# Explicitly exit so busy Processor threads can't block
|
|
||||||
# process shutdown.
|
|
||||||
logger.info "Bye!"
|
logger.info "Bye!"
|
||||||
|
|
||||||
|
# Explicitly exit so busy Processor threads won't block process shutdown.
|
||||||
|
#
|
||||||
|
# NB: slow at_exit handlers will prevent a timely exit if they take
|
||||||
|
# a while to run. If Sidekiq is getting here but the process isn't exiting,
|
||||||
|
# use the TTIN signal to determine where things are stuck.
|
||||||
exit(0)
|
exit(0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -266,7 +269,7 @@ module Sidekiq
|
||||||
if !File.exist?(options[:require]) ||
|
if !File.exist?(options[:require]) ||
|
||||||
(File.directory?(options[:require]) && !File.exist?("#{options[:require]}/config/application.rb"))
|
(File.directory?(options[:require]) && !File.exist?("#{options[:require]}/config/application.rb"))
|
||||||
logger.info "=================================================================="
|
logger.info "=================================================================="
|
||||||
logger.info " Please point sidekiq to a Rails 4/5 application or a Ruby file "
|
logger.info " Please point Sidekiq to a Rails application or a Ruby file "
|
||||||
logger.info " to load your worker classes with -r [DIR|FILE]."
|
logger.info " to load your worker classes with -r [DIR|FILE]."
|
||||||
logger.info "=================================================================="
|
logger.info "=================================================================="
|
||||||
logger.info @parser
|
logger.info @parser
|
||||||
|
@ -287,7 +290,7 @@ module Sidekiq
|
||||||
end
|
end
|
||||||
|
|
||||||
o.on "-d", "--daemon", "Daemonize process" do |arg|
|
o.on "-d", "--daemon", "Daemonize process" do |arg|
|
||||||
puts "WARNING: Daemonization mode was removed in Sidekiq 6.0, please use a proper process supervisor to start and manage your services"
|
puts "ERROR: Daemonization mode was removed in Sidekiq 6.0, please use a proper process supervisor to start and manage your services"
|
||||||
end
|
end
|
||||||
|
|
||||||
o.on "-e", "--environment ENV", "Application environment" do |arg|
|
o.on "-e", "--environment ENV", "Application environment" do |arg|
|
||||||
|
@ -320,11 +323,11 @@ module Sidekiq
|
||||||
end
|
end
|
||||||
|
|
||||||
o.on "-L", "--logfile PATH", "path to writable logfile" do |arg|
|
o.on "-L", "--logfile PATH", "path to writable logfile" do |arg|
|
||||||
puts "WARNING: Logfile redirection was removed in Sidekiq 6.0, Sidekiq will only log to STDOUT"
|
puts "ERROR: Logfile redirection was removed in Sidekiq 6.0, Sidekiq will only log to STDOUT"
|
||||||
end
|
end
|
||||||
|
|
||||||
o.on "-P", "--pidfile PATH", "path to pidfile" do |arg|
|
o.on "-P", "--pidfile PATH", "path to pidfile" do |arg|
|
||||||
puts "WARNING: PID file creation was removed in Sidekiq 6.0, please use a proper process supervisor to start and manage your services"
|
puts "ERROR: PID file creation was removed in Sidekiq 6.0, please use a proper process supervisor to start and manage your services"
|
||||||
end
|
end
|
||||||
|
|
||||||
o.on "-V", "--version", "Print version and exit" do |arg|
|
o.on "-V", "--version", "Print version and exit" do |arg|
|
||||||
|
@ -360,12 +363,6 @@ module Sidekiq
|
||||||
opts = opts.merge(opts.delete(environment.to_sym) || {})
|
opts = opts.merge(opts.delete(environment.to_sym) || {})
|
||||||
parse_queues(opts, opts.delete(:queues) || [])
|
parse_queues(opts, opts.delete(:queues) || [])
|
||||||
|
|
||||||
ns = opts.delete(:namespace)
|
|
||||||
if ns
|
|
||||||
# logger hasn't been initialized yet, puts is all we have.
|
|
||||||
puts("namespace should be set in your ruby initializer, is ignored in config file")
|
|
||||||
puts("config.redis = { :url => ..., :namespace => '#{ns}' }")
|
|
||||||
end
|
|
||||||
opts
|
opts
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,7 @@ require "sidekiq/fetch"
|
||||||
require "sidekiq/scheduled"
|
require "sidekiq/scheduled"
|
||||||
|
|
||||||
module Sidekiq
|
module Sidekiq
|
||||||
# The Launcher is a very simple Actor whose job is to
|
# The Launcher starts the Manager and Poller threads and provides the process heartbeat.
|
||||||
# start, monitor and stop the core Actors in Sidekiq.
|
|
||||||
# If any of these actors die, the Sidekiq process exits
|
|
||||||
# immediately.
|
|
||||||
class Launcher
|
class Launcher
|
||||||
include Util
|
include Util
|
||||||
|
|
||||||
|
|
|
@ -124,8 +124,8 @@ module Sidekiq
|
||||||
REDIS_PROVIDER should be set to the name of the variable which contains the Redis URL, not a URL itself.
|
REDIS_PROVIDER should be set to the name of the variable which contains the Redis URL, not a URL itself.
|
||||||
Platforms like Heroku will sell addons that publish a *_URL variable. You need to tell Sidekiq with REDIS_PROVIDER, e.g.:
|
Platforms like Heroku will sell addons that publish a *_URL variable. You need to tell Sidekiq with REDIS_PROVIDER, e.g.:
|
||||||
|
|
||||||
REDIS_PROVIDER=REDISTOGO_URL
|
|
||||||
REDISTOGO_URL=redis://somehost.example.com:6379/4
|
REDISTOGO_URL=redis://somehost.example.com:6379/4
|
||||||
|
REDIS_PROVIDER=REDISTOGO_URL
|
||||||
EOM
|
EOM
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -39,8 +39,9 @@ module Sidekiq
|
||||||
# Allows customization for this type of Worker.
|
# Allows customization for this type of Worker.
|
||||||
# Legal options:
|
# Legal options:
|
||||||
#
|
#
|
||||||
# retry - enable the RetryJobs middleware for this Worker, *true* to use the default
|
# queue - name of queue to use for this job type, default *default*
|
||||||
# or *Integer* count
|
# retry - enable retries for this Worker in case of error during execution,
|
||||||
|
# *true* to use the default or *Integer* count
|
||||||
# backtrace - whether to save any error backtrace in the retry payload to display in web UI,
|
# backtrace - whether to save any error backtrace in the retry payload to display in web UI,
|
||||||
# can be true, false or an integer number of lines to save, default *false*
|
# can be true, false or an integer number of lines to save, default *false*
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue