sidekiq 0.7.0 → 0.8.0
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 +10 -0
- data/README.md +1 -1
- data/TODO.md +1 -0
- data/examples/config.yml +11 -0
- data/lib/sidekiq.rb +12 -2
- data/lib/sidekiq/capistrano.rb +29 -0
- data/lib/sidekiq/cli.rb +4 -6
- data/lib/sidekiq/manager.rb +10 -1
- data/lib/sidekiq/middleware/server/exception_handler.rb +38 -0
- data/lib/sidekiq/middleware/server/logging.rb +27 -0
- data/lib/sidekiq/processor.rb +6 -2
- data/lib/sidekiq/util.rb +10 -1
- data/lib/sidekiq/version.rb +1 -1
- data/myapp/Capfile +5 -0
- data/myapp/Gemfile +1 -0
- data/myapp/config/deploy.rb +15 -0
- data/myapp/config/initializers/sidekiq.rb +2 -2
- data/test/config.yml +0 -2
- data/test/test_cli.rb +0 -9
- data/test/test_client.rb +2 -2
- data/test/test_extensions.rb +2 -1
- data/test/test_manager.rb +2 -1
- data/test/test_middleware.rb +1 -1
- data/test/test_processor.rb +1 -2
- data/test/test_stats.rb +2 -1
- metadata +27 -22
- data/.travis.yml +0 -3
- data/lib/sidekiq/middleware/server/airbrake.rb +0 -30
data/Changes.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
0.8.0
|
2
|
+
-----------
|
3
|
+
|
4
|
+
- Remove :namespace and :server CLI options (mperham)
|
5
|
+
- Add ExceptionNotifier support (masterkain)
|
6
|
+
- Add capistrano support (mperham)
|
7
|
+
- Workers now log upon start and finish (mperham)
|
8
|
+
- Messages for terminated workers are now automatically requeued (mperham)
|
9
|
+
- Add support for Exceptional error reporting (bensie)
|
10
|
+
|
1
11
|
0.7.0
|
2
12
|
-----------
|
3
13
|
|
data/README.md
CHANGED
data/TODO.md
CHANGED
data/examples/config.yml
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Sample configuration file for Sidekiq.
|
2
|
+
# Options here can still be overridden by cmd line args.
|
3
|
+
# sidekiq -C config.yml
|
4
|
+
---
|
5
|
+
:verbose: false
|
6
|
+
:namespace: test_namespace
|
7
|
+
:server: 127.0.0.1:1234
|
8
|
+
:concurrency: 25
|
9
|
+
:queues:
|
10
|
+
- [often, 2]
|
11
|
+
- [seldom, 1]
|
data/lib/sidekiq.rb
CHANGED
@@ -55,8 +55,18 @@ module Sidekiq
|
|
55
55
|
@redis ||= Sidekiq::RedisConnection.create
|
56
56
|
end
|
57
57
|
|
58
|
-
def self.redis=(
|
59
|
-
|
58
|
+
def self.redis=(hash)
|
59
|
+
if !hash.is_a?(Hash)
|
60
|
+
puts "*****************************************************
|
61
|
+
Sidekiq.redis now takes a Hash:
|
62
|
+
old: Sidekiq.redis = Sidekiq::RedisConnection.create(:url => 'redis://foo.com', :namespace => 'abc', :size => 12)
|
63
|
+
new: Sidekiq.redis = { :url => 'redis://foo.com', :namespace => 'xyz', :size => 12 }
|
64
|
+
Called from #{caller[0]}
|
65
|
+
*****************************************************"
|
66
|
+
@redis = hash
|
67
|
+
else
|
68
|
+
@redis = RedisConnection.create(hash)
|
69
|
+
end
|
60
70
|
end
|
61
71
|
|
62
72
|
def self.client_middleware
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Capistrano::Configuration.instance.load do
|
2
|
+
after "deploy", "sidekiq:restart"
|
3
|
+
|
4
|
+
namespace :sidekiq do
|
5
|
+
|
6
|
+
desc "Force stop sidekiq"
|
7
|
+
task :kill do
|
8
|
+
run "cd #{current_path} && kill `cat tmp/pids/sidekiq.pid` && sleep 5 && kill -9 `cat tmp/pids/sidekiq.pid`"
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Stop sidekiq"
|
12
|
+
task :stop do
|
13
|
+
run "cd #{current_path} && kill `cat tmp/pids/sidekiq.pid`"
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "Start sidekiq"
|
17
|
+
task :start do
|
18
|
+
rails_env = fetch(:rails_env, "production")
|
19
|
+
run "cd #{current_path} && nohup bundle exec sidekiq -e #{rails_env} -C config/sidekiq.yml -P tmp/pids/sidekiq.pid &>> log/sidekiq.log &"
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Restart sidekiq"
|
23
|
+
task :restart do
|
24
|
+
stop
|
25
|
+
start
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
data/lib/sidekiq/cli.rb
CHANGED
@@ -13,7 +13,6 @@ require 'yaml'
|
|
13
13
|
require 'optparse'
|
14
14
|
require 'sidekiq'
|
15
15
|
require 'sidekiq/util'
|
16
|
-
require 'sidekiq/redis_connection'
|
17
16
|
require 'sidekiq/manager'
|
18
17
|
|
19
18
|
module Sidekiq
|
@@ -42,7 +41,6 @@ module Sidekiq
|
|
42
41
|
end
|
43
42
|
|
44
43
|
def run
|
45
|
-
Sidekiq.redis ||= RedisConnection.create(:url => options[:server], :namespace => options[:namespace])
|
46
44
|
manager = Sidekiq::Manager.new(options)
|
47
45
|
begin
|
48
46
|
logger.info 'Starting processing, hit Ctrl-C to stop'
|
@@ -113,12 +111,12 @@ module Sidekiq
|
|
113
111
|
set_logger_level_to_debug
|
114
112
|
end
|
115
113
|
|
116
|
-
o.on "-n", "--namespace NAMESPACE", "namespace worker queues are under" do |arg|
|
117
|
-
|
114
|
+
o.on "-n", "--namespace NAMESPACE", "namespace worker queues are under (DEPRECATED)" do |arg|
|
115
|
+
puts "Namespace support has been removed, see https://github.com/mperham/sidekiq/issues/61"
|
118
116
|
end
|
119
117
|
|
120
|
-
o.on "-s", "--server LOCATION", "Where to find Redis" do |arg|
|
121
|
-
|
118
|
+
o.on "-s", "--server LOCATION", "Where to find Redis (DEPRECATED)" do |arg|
|
119
|
+
puts "Server location support has been removed, see https://github.com/mperham/sidekiq/issues/61"
|
122
120
|
end
|
123
121
|
|
124
122
|
o.on '-e', '--environment ENV', "Application environment" do |arg|
|
data/lib/sidekiq/manager.rb
CHANGED
@@ -49,7 +49,13 @@ module Sidekiq
|
|
49
49
|
logger.info("Pausing 5 seconds to allow workers to finish...")
|
50
50
|
after(5) do
|
51
51
|
@busy.each(&:terminate)
|
52
|
-
|
52
|
+
redis.with_connection do |conn|
|
53
|
+
conn.multi do
|
54
|
+
@busy.each do |busy|
|
55
|
+
conn.lpush("queue:#{busy.queue}", busy.msg)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
53
59
|
signal(:shutdown)
|
54
60
|
end
|
55
61
|
end
|
@@ -66,6 +72,7 @@ module Sidekiq
|
|
66
72
|
watchdog('sidekiq processor_done crashed!') do
|
67
73
|
@done_callback.call(processor) if @done_callback
|
68
74
|
@busy.delete(processor)
|
75
|
+
processor.msg = processor.queue = nil
|
69
76
|
if stopped?
|
70
77
|
processor.terminate if processor.alive?
|
71
78
|
else
|
@@ -91,6 +98,8 @@ module Sidekiq
|
|
91
98
|
if msg
|
92
99
|
processor = @ready.pop
|
93
100
|
@busy << processor
|
101
|
+
processor.msg = msg
|
102
|
+
processor.queue = queue
|
94
103
|
processor.process!(MultiJson.decode(msg), queue)
|
95
104
|
end
|
96
105
|
!!msg
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'sidekiq/util'
|
2
|
+
|
3
|
+
module Sidekiq
|
4
|
+
module Middleware
|
5
|
+
module Server
|
6
|
+
class ExceptionHandler
|
7
|
+
include Util
|
8
|
+
def call(*args)
|
9
|
+
yield
|
10
|
+
rescue => ex
|
11
|
+
logger.warn ex
|
12
|
+
logger.warn ex.backtrace.join("\n")
|
13
|
+
send_to_airbrake(args[1], ex) if defined?(::Airbrake)
|
14
|
+
send_to_exceptional(args[1], ex) if defined?(::Exceptional)
|
15
|
+
send_to_exception_notifier(args[1], ex) if defined?(::ExceptionNotifier)
|
16
|
+
raise
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def send_to_airbrake(msg, ex)
|
22
|
+
::Airbrake.notify(ex, :parameters => msg)
|
23
|
+
end
|
24
|
+
|
25
|
+
def send_to_exceptional(msg, ex)
|
26
|
+
if ::Exceptional::Config.should_send_to_api?
|
27
|
+
::Exceptional.context(msg)
|
28
|
+
::Exceptional::Remote.error(::Exceptional::ExceptionData.new(ex))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def send_to_exception_notifier(msg, ex)
|
33
|
+
::ExceptionNotifier::Notifier.background_exception_notification(ex, :data => { :message => msg })
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Sidekiq
|
2
|
+
module Middleware
|
3
|
+
module Server
|
4
|
+
class Logging
|
5
|
+
def call(*args)
|
6
|
+
static = "#{args[0].class.to_s} MSG-#{args[0].object_id.to_s(36)}" if logger.info?
|
7
|
+
start = Time.now
|
8
|
+
logger.info { "#{static} start" }
|
9
|
+
yield
|
10
|
+
logger.info { "#{static} done: #{elapsed(start)} sec" }
|
11
|
+
rescue
|
12
|
+
logger.info { "#{static} fail: #{elapsed(start)} sec" }
|
13
|
+
raise
|
14
|
+
end
|
15
|
+
|
16
|
+
def elapsed(start)
|
17
|
+
(Time.now - start).to_f.round(3)
|
18
|
+
end
|
19
|
+
|
20
|
+
def logger
|
21
|
+
Sidekiq::Util.logger
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
data/lib/sidekiq/processor.rb
CHANGED
@@ -2,9 +2,10 @@ require 'celluloid'
|
|
2
2
|
require 'sidekiq/util'
|
3
3
|
|
4
4
|
require 'sidekiq/middleware/server/active_record'
|
5
|
-
require 'sidekiq/middleware/server/
|
5
|
+
require 'sidekiq/middleware/server/exception_handler'
|
6
6
|
require 'sidekiq/middleware/server/unique_jobs'
|
7
7
|
require 'sidekiq/middleware/server/failure_jobs'
|
8
|
+
require 'sidekiq/middleware/server/logging'
|
8
9
|
|
9
10
|
module Sidekiq
|
10
11
|
class Processor
|
@@ -17,12 +18,15 @@ module Sidekiq
|
|
17
18
|
|
18
19
|
def self.default_middleware
|
19
20
|
Middleware::Chain.new do |m|
|
20
|
-
m.add Middleware::Server::
|
21
|
+
m.add Middleware::Server::ExceptionHandler
|
22
|
+
m.add Middleware::Server::Logging
|
21
23
|
m.add Middleware::Server::UniqueJobs
|
22
24
|
m.add Middleware::Server::ActiveRecord
|
23
25
|
end
|
24
26
|
end
|
25
27
|
|
28
|
+
attr_accessor :msg, :queue
|
29
|
+
|
26
30
|
def initialize(boss)
|
27
31
|
@boss = boss
|
28
32
|
redis.sadd('workers', self)
|
data/lib/sidekiq/util.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'time'
|
1
2
|
require 'logger'
|
2
3
|
|
3
4
|
module Sidekiq
|
@@ -6,10 +7,18 @@ module Sidekiq
|
|
6
7
|
#
|
7
8
|
module Util
|
8
9
|
|
10
|
+
class Pretty < Logger::Formatter
|
11
|
+
# Provide a call() method that returns the formatted message.
|
12
|
+
def call(severity, time, program_name, message)
|
13
|
+
"#{time.utc.iso8601} #{Process.pid} TID-#{Thread.current.object_id.to_s(36)} #{severity}: #{message}\n"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
9
17
|
def self.logger
|
10
18
|
@logger ||= begin
|
11
|
-
log = Logger.new(
|
19
|
+
log = Logger.new(STDOUT)
|
12
20
|
log.level = Logger::INFO
|
21
|
+
log.formatter = Pretty.new
|
13
22
|
log
|
14
23
|
end
|
15
24
|
end
|
data/lib/sidekiq/version.rb
CHANGED
data/myapp/Capfile
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
load 'deploy'
|
2
|
+
# Uncomment if you are using Rails' asset pipeline
|
3
|
+
# load 'deploy/assets'
|
4
|
+
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
|
5
|
+
load 'config/deploy' # remove this line to skip loading any of the default tasks
|
data/myapp/Gemfile
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'bundler/capistrano'
|
2
|
+
require 'sidekiq/capistrano'
|
3
|
+
|
4
|
+
set :scm, :git
|
5
|
+
set :repository, 'git@github.com:mperham/sidekiq'
|
6
|
+
ssh_options[:forward_agent] = true
|
7
|
+
|
8
|
+
default_run_options[:pty] = true # needed to run sudo
|
9
|
+
set :user, 'mperham'
|
10
|
+
set :application, "myapp"
|
11
|
+
set :deploy_via, :remote_cache
|
12
|
+
|
13
|
+
role :web, "localhost"
|
14
|
+
role :app, "localhost"
|
15
|
+
role :db, "localhost", :primary => true
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Sidekiq.configure_client do |config|
|
2
|
-
config.redis =
|
2
|
+
config.redis = { :namespace => 'resque', :size => 2 }
|
3
3
|
end
|
4
4
|
Sidekiq.configure_server do |config|
|
5
|
-
config.redis =
|
5
|
+
config.redis = { :namespace => 'resque', :size => 25 }
|
6
6
|
end
|
data/test/config.yml
CHANGED
data/test/test_cli.rb
CHANGED
@@ -70,10 +70,6 @@ class TestCli < MiniTest::Unit::TestCase
|
|
70
70
|
refute Sidekiq.options[:verbose]
|
71
71
|
end
|
72
72
|
|
73
|
-
it 'sets namespace' do
|
74
|
-
assert_equal "test_namespace", Sidekiq.options[:namespace]
|
75
|
-
end
|
76
|
-
|
77
73
|
it 'sets require file' do
|
78
74
|
assert_equal './test/fake_env.rb', Sidekiq.options[:require]
|
79
75
|
end
|
@@ -110,7 +106,6 @@ class TestCli < MiniTest::Unit::TestCase
|
|
110
106
|
|
111
107
|
@cli.parse(['sidekiq',
|
112
108
|
'-C', './test/config.yml',
|
113
|
-
'-n', 'sweet_story_bro',
|
114
109
|
'-e', 'snoop',
|
115
110
|
'-c', '100',
|
116
111
|
'-r', @tmp_lib_path,
|
@@ -128,10 +123,6 @@ class TestCli < MiniTest::Unit::TestCase
|
|
128
123
|
assert_equal 100, Sidekiq.options[:concurrency]
|
129
124
|
end
|
130
125
|
|
131
|
-
it 'uses namespace flag' do
|
132
|
-
assert_equal "sweet_story_bro", Sidekiq.options[:namespace]
|
133
|
-
end
|
134
|
-
|
135
126
|
it 'uses require file flag' do
|
136
127
|
assert_equal @tmp_lib_path, Sidekiq.options[:require]
|
137
128
|
end
|
data/test/test_client.rb
CHANGED
@@ -5,7 +5,7 @@ require 'sidekiq/worker'
|
|
5
5
|
class TestClient < MiniTest::Unit::TestCase
|
6
6
|
describe 'with real redis' do
|
7
7
|
before do
|
8
|
-
Sidekiq.redis =
|
8
|
+
Sidekiq.redis = { :url => 'redis://localhost/sidekiq_test' }
|
9
9
|
Sidekiq.redis.flushdb
|
10
10
|
end
|
11
11
|
|
@@ -39,7 +39,7 @@ class TestClient < MiniTest::Unit::TestCase
|
|
39
39
|
def @redis.setex(*); nil; end
|
40
40
|
def @redis.expire(*); true; end
|
41
41
|
def @redis.with_connection; yield self; end
|
42
|
-
Sidekiq.redis
|
42
|
+
Sidekiq.instance_variable_set(:@redis, @redis)
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'raises ArgumentError with invalid params' do
|
data/test/test_extensions.rb
CHANGED
@@ -10,7 +10,8 @@ class TestExtensions < MiniTest::Unit::TestCase
|
|
10
10
|
describe 'sidekiq extensions' do
|
11
11
|
before do
|
12
12
|
Sidekiq.client_middleware.entries.clear
|
13
|
-
Sidekiq.redis
|
13
|
+
Sidekiq.instance_variable_set(:@redis, MiniTest::Mock.new)
|
14
|
+
@redis = Sidekiq.redis
|
14
15
|
end
|
15
16
|
|
16
17
|
class MyModel < ActiveRecord::Base
|
data/test/test_manager.rb
CHANGED
@@ -8,7 +8,8 @@ require 'connection_pool'
|
|
8
8
|
class TestManager < MiniTest::Unit::TestCase
|
9
9
|
describe 'with redis' do
|
10
10
|
before do
|
11
|
-
Sidekiq.redis =
|
11
|
+
Sidekiq.redis = { :url => 'redis://localhost/sidekiq_test' }
|
12
|
+
@redis = Sidekiq.redis
|
12
13
|
@redis.flushdb
|
13
14
|
$processed = 0
|
14
15
|
$mutex = Mutex.new
|
data/test/test_middleware.rb
CHANGED
@@ -6,7 +6,7 @@ require 'sidekiq/processor'
|
|
6
6
|
class TestMiddleware < MiniTest::Unit::TestCase
|
7
7
|
describe 'middleware chain' do
|
8
8
|
before do
|
9
|
-
Sidekiq.redis =
|
9
|
+
Sidekiq.redis = { :url => 'redis://localhost/sidekiq_test' }
|
10
10
|
end
|
11
11
|
|
12
12
|
class CustomMiddleware
|
data/test/test_processor.rb
CHANGED
@@ -37,7 +37,6 @@ class TestProcessor < MiniTest::Unit::TestCase
|
|
37
37
|
@boss.verify
|
38
38
|
assert_equal 0, $invokes
|
39
39
|
assert_equal 1, $errors.size
|
40
|
-
assert_equal "RuntimeError", $errors[0][:error_class]
|
41
40
|
assert_equal msg, $errors[0][:parameters]
|
42
41
|
end
|
43
42
|
|
@@ -45,7 +44,7 @@ class TestProcessor < MiniTest::Unit::TestCase
|
|
45
44
|
end
|
46
45
|
|
47
46
|
class FakeAirbrake
|
48
|
-
def self.notify(hash)
|
47
|
+
def self.notify(ex, hash)
|
49
48
|
$errors << hash
|
50
49
|
end
|
51
50
|
end
|
data/test/test_stats.rb
CHANGED
@@ -5,7 +5,8 @@ require 'sidekiq/processor'
|
|
5
5
|
class TestStats < MiniTest::Unit::TestCase
|
6
6
|
describe 'with redis' do
|
7
7
|
before do
|
8
|
-
Sidekiq.redis =
|
8
|
+
Sidekiq.redis = { :url => 'redis://localhost/sidekiq_test' }
|
9
|
+
@redis = Sidekiq.redis
|
9
10
|
@redis.flushdb
|
10
11
|
end
|
11
12
|
|
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: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-02
|
12
|
+
date: 2012-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|
16
|
-
requirement: &
|
16
|
+
requirement: &70185139523000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70185139523000
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: redis-namespace
|
27
|
-
requirement: &
|
27
|
+
requirement: &70185139512240 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70185139512240
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: connection_pool
|
38
|
-
requirement: &
|
38
|
+
requirement: &70185139511020 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70185139511020
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: celluloid
|
49
|
-
requirement: &
|
49
|
+
requirement: &70185139509380 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70185139509380
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: multi_json
|
60
|
-
requirement: &
|
60
|
+
requirement: &70185139508520 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70185139508520
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitest
|
71
|
-
requirement: &
|
71
|
+
requirement: &70185139506420 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70185139506420
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: rake
|
82
|
-
requirement: &
|
82
|
+
requirement: &70185139505520 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70185139505520
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: actionmailer
|
93
|
-
requirement: &
|
93
|
+
requirement: &70185139503040 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70185139503040
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: activerecord
|
104
|
-
requirement: &
|
104
|
+
requirement: &70185139500600 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70185139500600
|
113
113
|
description: Simple, efficient message processing for Ruby
|
114
114
|
email:
|
115
115
|
- mperham@gmail.com
|
@@ -120,7 +120,6 @@ extra_rdoc_files: []
|
|
120
120
|
files:
|
121
121
|
- .gitignore
|
122
122
|
- .rvmrc
|
123
|
-
- .travis.yml
|
124
123
|
- COMM-LICENSE
|
125
124
|
- Changes.md
|
126
125
|
- Gemfile
|
@@ -135,10 +134,12 @@ files:
|
|
135
134
|
- examples/chef/cookbooks/sidekiq/templates/default/monitrc.conf.erb
|
136
135
|
- examples/chef/cookbooks/sidekiq/templates/default/sidekiq.erb
|
137
136
|
- examples/chef/cookbooks/sidekiq/templates/default/sidekiq.yml.erb
|
137
|
+
- examples/config.yml
|
138
138
|
- examples/monitrc.conf
|
139
139
|
- examples/por.rb
|
140
140
|
- examples/sinkiq.rb
|
141
141
|
- lib/sidekiq.rb
|
142
|
+
- lib/sidekiq/capistrano.rb
|
142
143
|
- lib/sidekiq/cli.rb
|
143
144
|
- lib/sidekiq/client.rb
|
144
145
|
- lib/sidekiq/extensions/action_mailer.rb
|
@@ -149,8 +150,9 @@ files:
|
|
149
150
|
- lib/sidekiq/middleware/client/resque_web_compatibility.rb
|
150
151
|
- lib/sidekiq/middleware/client/unique_jobs.rb
|
151
152
|
- lib/sidekiq/middleware/server/active_record.rb
|
152
|
-
- lib/sidekiq/middleware/server/
|
153
|
+
- lib/sidekiq/middleware/server/exception_handler.rb
|
153
154
|
- lib/sidekiq/middleware/server/failure_jobs.rb
|
155
|
+
- lib/sidekiq/middleware/server/logging.rb
|
154
156
|
- lib/sidekiq/middleware/server/unique_jobs.rb
|
155
157
|
- lib/sidekiq/processor.rb
|
156
158
|
- lib/sidekiq/rails.rb
|
@@ -160,6 +162,7 @@ files:
|
|
160
162
|
- lib/sidekiq/version.rb
|
161
163
|
- lib/sidekiq/worker.rb
|
162
164
|
- myapp/.gitignore
|
165
|
+
- myapp/Capfile
|
163
166
|
- myapp/Gemfile
|
164
167
|
- myapp/Gemfile.lock
|
165
168
|
- myapp/Rakefile
|
@@ -178,6 +181,7 @@ files:
|
|
178
181
|
- myapp/config/application.rb
|
179
182
|
- myapp/config/boot.rb
|
180
183
|
- myapp/config/database.yml
|
184
|
+
- myapp/config/deploy.rb
|
181
185
|
- myapp/config/environment.rb
|
182
186
|
- myapp/config/environments/development.rb
|
183
187
|
- myapp/config/environments/production.rb
|
@@ -245,3 +249,4 @@ test_files:
|
|
245
249
|
- test/test_processor.rb
|
246
250
|
- test/test_stats.rb
|
247
251
|
- test/test_testing.rb
|
252
|
+
has_rdoc:
|
data/.travis.yml
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'sidekiq/util'
|
2
|
-
|
3
|
-
module Sidekiq
|
4
|
-
module Middleware
|
5
|
-
module Server
|
6
|
-
class Airbrake
|
7
|
-
include Util
|
8
|
-
def call(*args)
|
9
|
-
yield
|
10
|
-
rescue => ex
|
11
|
-
logger.warn ex
|
12
|
-
logger.warn ex.backtrace.join("\n")
|
13
|
-
send_to_airbrake(args[1], ex) if defined?(::Airbrake)
|
14
|
-
raise
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def send_to_airbrake(msg, ex)
|
20
|
-
::Airbrake.notify(:error_class => ex.class.name,
|
21
|
-
:error_message => "#{ex.class.name}: #{ex.message}",
|
22
|
-
:parameters => msg)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
|
30
|
-
|