sidekiq 2.7.4 → 2.7.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sidekiq might be problematic. Click here for more details.
- data/Changes.md +7 -0
- data/examples/web-ui.png +0 -0
- data/lib/sidekiq/capistrano.rb +1 -1
- data/lib/sidekiq/cli.rb +48 -45
- data/lib/sidekiq/version.rb +1 -1
- data/web/views/dashboard.slim +5 -5
- metadata +2 -2
data/Changes.md
CHANGED
data/examples/web-ui.png
CHANGED
Binary file
|
data/lib/sidekiq/capistrano.rb
CHANGED
@@ -36,7 +36,7 @@ Capistrano::Configuration.instance.load do
|
|
36
36
|
task :start, :roles => lambda { fetch(:sidekiq_role) }, :on_no_matching_servers => :continue do
|
37
37
|
rails_env = fetch(:rails_env, "production")
|
38
38
|
for_each_process do |pid_file, idx|
|
39
|
-
run "cd #{current_path} ; #{fetch(:sidekiq_cmd)} -
|
39
|
+
run "cd #{current_path} ; nohup #{fetch(:sidekiq_cmd)} -e #{rails_env} -C #{current_path}/config/sidekiq.yml -i #{idx} -P #{pid_file} >> #{current_path}/log/sidekiq.log 2>&1 &", :pty => false
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
data/lib/sidekiq/cli.rb
CHANGED
@@ -1,42 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# Handle Ctrl-C in JRuby like MRI
|
10
|
-
# http://jira.codehaus.org/browse/JRUBY-4637
|
11
|
-
Sidekiq::CLI.instance.interrupt
|
12
|
-
end
|
13
|
-
|
14
|
-
trap 'TERM' do
|
15
|
-
# Heroku sends TERM and then waits 10 seconds for process to exit.
|
16
|
-
Sidekiq::CLI.instance.interrupt
|
17
|
-
end
|
18
|
-
|
19
|
-
trap 'USR1' do
|
20
|
-
Sidekiq.logger.info "Received USR1, no longer accepting new work"
|
21
|
-
mgr = Sidekiq::CLI.instance.launcher.manager
|
22
|
-
mgr.async.stop if mgr
|
23
|
-
end
|
24
|
-
|
25
|
-
trap 'USR2' do
|
26
|
-
if Sidekiq.options[:logfile]
|
27
|
-
Sidekiq.logger.info "Received USR2, reopening log file"
|
28
|
-
Sidekiq::Logging.initialize_logger(Sidekiq.options[:logfile])
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
trap 'TTIN' do
|
33
|
-
Thread.list.each do |thread|
|
34
|
-
Sidekiq.logger.info "Thread TID-#{thread.object_id.to_s(36)} #{thread['label']}"
|
35
|
-
if thread.backtrace
|
36
|
-
Sidekiq.logger.info thread.backtrace.join("\n")
|
37
|
-
else
|
38
|
-
Sidekiq.logger.info "<no backtrace available>"
|
39
|
-
end
|
1
|
+
$sidekiq_signals = []
|
2
|
+
|
3
|
+
# Signal handlers should do as little as humanly possible
|
4
|
+
# and defer all work to a non-trap context. We'll have
|
5
|
+
# the main thread poll for signals and handle them there.
|
6
|
+
%w(INT TERM USR1 USR2 TTIN).each do |sig|
|
7
|
+
trap sig do
|
8
|
+
$sidekiq_signals << sig
|
40
9
|
end
|
41
10
|
end
|
42
11
|
|
@@ -99,7 +68,11 @@ module Sidekiq
|
|
99
68
|
RubyProf.start
|
100
69
|
end
|
101
70
|
launcher.run
|
102
|
-
|
71
|
+
|
72
|
+
while true
|
73
|
+
handle_signals
|
74
|
+
sleep 1
|
75
|
+
end
|
103
76
|
rescue Interrupt
|
104
77
|
logger.info 'Shutting down'
|
105
78
|
launcher.stop
|
@@ -109,11 +82,41 @@ module Sidekiq
|
|
109
82
|
end
|
110
83
|
end
|
111
84
|
|
112
|
-
def
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
85
|
+
def handle_signals
|
86
|
+
while sig = $sidekiq_signals.shift
|
87
|
+
Sidekiq.logger.debug "Got #{sig} signal"
|
88
|
+
case sig
|
89
|
+
when 'INT'
|
90
|
+
if Sidekiq.options[:profile]
|
91
|
+
result = RubyProf.stop
|
92
|
+
printer = RubyProf::GraphHtmlPrinter.new(result)
|
93
|
+
File.open("profile.html", 'w') do |f|
|
94
|
+
printer.print(f, :min_percent => 1)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
# Handle Ctrl-C in JRuby like MRI
|
98
|
+
# http://jira.codehaus.org/browse/JRUBY-4637
|
99
|
+
raise Interrupt
|
100
|
+
when 'TERM'
|
101
|
+
# Heroku sends TERM and then waits 10 seconds for process to exit.
|
102
|
+
raise Interrupt
|
103
|
+
when 'USR1'
|
104
|
+
Sidekiq.logger.info "Received USR1, no longer accepting new work"
|
105
|
+
launcher.manager.async.stop
|
106
|
+
when 'USR2'
|
107
|
+
if Sidekiq.options[:logfile]
|
108
|
+
Sidekiq.logger.info "Received USR2, reopening log file"
|
109
|
+
Sidekiq::Logging.initialize_logger(Sidekiq.options[:logfile])
|
110
|
+
end
|
111
|
+
when 'TTIN'
|
112
|
+
Thread.list.each do |thread|
|
113
|
+
Sidekiq.logger.info "Thread TID-#{thread.object_id.to_s(36)} #{thread['label']}"
|
114
|
+
if thread.backtrace
|
115
|
+
Sidekiq.logger.info thread.backtrace.join("\n")
|
116
|
+
else
|
117
|
+
Sidekiq.logger.info "<no backtrace available>"
|
118
|
+
end
|
119
|
+
end
|
117
120
|
end
|
118
121
|
end
|
119
122
|
end
|
data/lib/sidekiq/version.rb
CHANGED
data/web/views/dashboard.slim
CHANGED
@@ -11,11 +11,11 @@ h5 Real-time
|
|
11
11
|
|
12
12
|
h5
|
13
13
|
span.history-heading History
|
14
|
-
a href="#{{
|
15
|
-
a href="#{{
|
16
|
-
a href="#{{
|
17
|
-
a href="#{{
|
18
|
-
#history data-processed="#{Sidekiq.dump_json(@processed_history)}" data-failed="#{Sidekiq.dump_json(@failed_history)}" data-update-url="#{{
|
14
|
+
a href="#{{root_path}}?days=7" class="history-graph #{{"active" if params[:days] == "7"}}" 1 week
|
15
|
+
a href="#{{root_path}}" class="history-graph #{{"active" if params[:days].nil? || params[:days] == "30"}}" 1 month
|
16
|
+
a href="#{{root_path}}?days=90" class="history-graph #{{"active" if params[:days] == "90"}}" 3 month
|
17
|
+
a href="#{{root_path}}?days=180" class="history-graph #{{"active" if params[:days] == "180"}}" 6 month
|
18
|
+
#history data-processed="#{Sidekiq.dump_json(@processed_history)}" data-failed="#{Sidekiq.dump_json(@failed_history)}" data-update-url="#{{root_path}}dashboard/stats"
|
19
19
|
|
20
20
|
br
|
21
21
|
h5 Redis
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
12
|
- .public_cert.pem
|
13
|
-
date: 2013-02-
|
13
|
+
date: 2013-02-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: redis
|