sidekiq-throttled 0.15.0 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +12 -0
- data/.github/workflows/ci.yml +11 -10
- data/.rubocop.yml +8 -7
- data/.rubocop_todo.yml +39 -3
- data/Appraisals +8 -12
- data/CHANGES.md +44 -0
- data/Gemfile +7 -5
- data/LICENSE.md +1 -0
- data/README.md +36 -32
- data/Rakefile +1 -1
- data/gemfiles/sidekiq_6.0.gemfile +7 -5
- data/gemfiles/sidekiq_6.1.gemfile +7 -5
- data/gemfiles/sidekiq_6.2.gemfile +7 -5
- data/gemfiles/sidekiq_6.3.gemfile +7 -5
- data/gemfiles/{sidekiq_5.2.gemfile → sidekiq_6.4.gemfile} +8 -6
- data/gemfiles/{sidekiq_5.1.gemfile → sidekiq_6.5.gemfile} +8 -6
- data/lib/sidekiq/throttled/communicator/callbacks.rb +1 -1
- data/lib/sidekiq/throttled/communicator/exception_handler.rb +25 -0
- data/lib/sidekiq/throttled/communicator/listener.rb +1 -1
- data/lib/sidekiq/throttled/communicator.rb +1 -1
- data/lib/sidekiq/throttled/configuration.rb +4 -4
- data/lib/sidekiq/throttled/expirable_list.rb +2 -5
- data/lib/sidekiq/throttled/fetch/unit_of_work.rb +7 -2
- data/lib/sidekiq/throttled/fetch.rb +5 -1
- data/lib/sidekiq/throttled/job.rb +128 -0
- data/lib/sidekiq/throttled/strategy/base.rb +6 -2
- data/lib/sidekiq/throttled/version.rb +1 -1
- data/lib/sidekiq/throttled/web/stats.rb +5 -4
- data/lib/sidekiq/throttled/worker.rb +6 -121
- data/lib/sidekiq/throttled.rb +15 -9
- data/{.rubocop → rubocop}/layout.yml +0 -0
- data/{.rubocop → rubocop}/lint.yml +0 -0
- data/{.rubocop → rubocop}/metrics.yml +0 -0
- data/{.rubocop → rubocop}/performance.yml +0 -0
- data/{.rubocop → rubocop}/rspec.yml +1 -1
- data/{.rubocop → rubocop}/style.yml +0 -0
- data/sidekiq-throttled.gemspec +6 -4
- metadata +20 -17
- data/gemfiles/sidekiq_5.0.gemfile +0 -31
@@ -21,14 +21,14 @@ module Sidekiq
|
|
21
21
|
# Instructs throttler to lookup strategies in parent classes, if there's
|
22
22
|
# no own strategy:
|
23
23
|
#
|
24
|
-
# class
|
25
|
-
# include Sidekiq::
|
26
|
-
# include Sidekiq::
|
24
|
+
# class FooJob
|
25
|
+
# include Sidekiq::Job
|
26
|
+
# include Sidekiq::Throttled::Job
|
27
27
|
#
|
28
28
|
# sidekiq_throttle :concurrency => { :limit => 42 }
|
29
29
|
# end
|
30
30
|
#
|
31
|
-
# class
|
31
|
+
# class BarJob < FooJob
|
32
32
|
# end
|
33
33
|
#
|
34
34
|
# By default in the example above, `Bar` won't have throttling options.
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
require "monitor"
|
4
4
|
|
5
|
-
require "concurrent/utility/monotonic_time"
|
6
|
-
|
7
5
|
module Sidekiq
|
8
6
|
module Throttled
|
9
7
|
# List that tracks when elements were added and enumerates over those not
|
@@ -24,7 +22,6 @@ module Sidekiq
|
|
24
22
|
# It does not deduplicates elements. Eviction happens only upon elements
|
25
23
|
# retrieval (see {#each}).
|
26
24
|
#
|
27
|
-
# @see http://ruby-concurrency.github.io/concurrent-ruby/Concurrent.html#monotonic_time-class_method
|
28
25
|
# @see https://ruby-doc.org/core/Process.html#method-c-clock_gettime
|
29
26
|
# @see https://linux.die.net/man/3/clock_gettime
|
30
27
|
#
|
@@ -44,7 +41,7 @@ module Sidekiq
|
|
44
41
|
# @params element [Object]
|
45
42
|
# @return [ExpirableList] self
|
46
43
|
def <<(element)
|
47
|
-
@mon.synchronize { @arr << [
|
44
|
+
@mon.synchronize { @arr << [::Process.clock_gettime(::Process::CLOCK_MONOTONIC), element] }
|
48
45
|
self
|
49
46
|
end
|
50
47
|
|
@@ -58,7 +55,7 @@ module Sidekiq
|
|
58
55
|
return to_enum __method__ unless block_given?
|
59
56
|
|
60
57
|
@mon.synchronize do
|
61
|
-
horizon =
|
58
|
+
horizon = ::Process.clock_gettime(::Process::CLOCK_MONOTONIC) - @ttl
|
62
59
|
|
63
60
|
# drop all elements older than horizon
|
64
61
|
@arr.shift while @arr[0] && @arr[0][0] < horizon
|
@@ -49,9 +49,14 @@ module Sidekiq
|
|
49
49
|
# process was terminated. It is a reverse of whatever fetcher was
|
50
50
|
# doing to pull the job out of queue.
|
51
51
|
#
|
52
|
+
# @param [Redis] pipelined connection for requeing via Redis#pipelined
|
52
53
|
# @return [void]
|
53
|
-
def requeue
|
54
|
-
|
54
|
+
def requeue(pipeline = nil)
|
55
|
+
if pipeline
|
56
|
+
pipeline.rpush(QueueName.expand(queue_name), job)
|
57
|
+
else
|
58
|
+
Sidekiq.redis { |conn| conn.rpush(QueueName.expand(queue_name), job) }
|
59
|
+
end
|
55
60
|
end
|
56
61
|
|
57
62
|
# Pushes job back to the head of the queue, so that job won't be tried
|
@@ -22,7 +22,11 @@ module Sidekiq
|
|
22
22
|
return if units.empty?
|
23
23
|
|
24
24
|
Sidekiq.logger.debug { "Re-queueing terminated jobs" }
|
25
|
-
Sidekiq.redis
|
25
|
+
Sidekiq.redis do |conn|
|
26
|
+
conn.pipelined do |pipeline|
|
27
|
+
units.each { |unit| unit.requeue(pipeline) }
|
28
|
+
end
|
29
|
+
end
|
26
30
|
Sidekiq.logger.info("Pushed #{units.size} jobs back to Redis")
|
27
31
|
rescue => e
|
28
32
|
Sidekiq.logger.warn("Failed to requeue #{units.size} jobs: #{e}")
|
@@ -0,0 +1,128 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# internal
|
4
|
+
require "sidekiq/throttled/registry"
|
5
|
+
|
6
|
+
module Sidekiq
|
7
|
+
module Throttled
|
8
|
+
# Adds helpers to your worker classes
|
9
|
+
#
|
10
|
+
# @example Usage
|
11
|
+
#
|
12
|
+
# class MyJob
|
13
|
+
# include Sidekiq::Job
|
14
|
+
# include Sidekiq::Throttled::Job
|
15
|
+
#
|
16
|
+
# sidkiq_options :queue => :my_queue
|
17
|
+
# sidekiq_throttle :threshold => { :limit => 123, :period => 1.hour }
|
18
|
+
#
|
19
|
+
# def perform
|
20
|
+
# # ...
|
21
|
+
# end
|
22
|
+
# end
|
23
|
+
#
|
24
|
+
# @see ClassMethods
|
25
|
+
module Job
|
26
|
+
# Extends worker class with {ClassMethods}.
|
27
|
+
#
|
28
|
+
# @note Using `included` hook with extending worker with {ClassMethods}
|
29
|
+
# in order to make API inline with `include Sidekiq::Job`.
|
30
|
+
#
|
31
|
+
# @private
|
32
|
+
def self.included(worker)
|
33
|
+
worker.send(:extend, ClassMethods)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Helper methods added to the singleton class of destination
|
37
|
+
module ClassMethods
|
38
|
+
# Registers some strategy for the worker.
|
39
|
+
#
|
40
|
+
# @example Allow max 123 MyJob jobs per hour
|
41
|
+
#
|
42
|
+
# class MyJob
|
43
|
+
# include Sidekiq::Job
|
44
|
+
# include Sidekiq::Throttled::Job
|
45
|
+
#
|
46
|
+
# sidekiq_throttle({
|
47
|
+
# :threshold => { :limit => 123, :period => 1.hour }
|
48
|
+
# })
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# @example Allow max 10 concurrently running MyJob jobs
|
52
|
+
#
|
53
|
+
# class MyJob
|
54
|
+
# include Sidekiq::Job
|
55
|
+
# include Sidekiq::Throttled::Job
|
56
|
+
#
|
57
|
+
# sidekiq_throttle({
|
58
|
+
# :concurrency => { :limit => 10 }
|
59
|
+
# })
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# @example Allow max 10 concurrent MyJob jobs and max 123 per hour
|
63
|
+
#
|
64
|
+
# class MyJob
|
65
|
+
# include Sidekiq::Job
|
66
|
+
# include Sidekiq::Throttled::Job
|
67
|
+
#
|
68
|
+
# sidekiq_throttle({
|
69
|
+
# :threshold => { :limit => 123, :period => 1.hour },
|
70
|
+
# :concurrency => { :limit => 10 }
|
71
|
+
# })
|
72
|
+
# end
|
73
|
+
#
|
74
|
+
# @see Registry.add
|
75
|
+
# @return [void]
|
76
|
+
def sidekiq_throttle(**kwargs)
|
77
|
+
Registry.add(self, **kwargs)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Adds current worker to preconfigured throttling strategy. Allows
|
81
|
+
# sharing same pool for multiple workers.
|
82
|
+
#
|
83
|
+
# First of all we need to create shared throttling strategy:
|
84
|
+
#
|
85
|
+
# # Create google_api throttling strategy
|
86
|
+
# Sidekiq::Throttled::Registry.add(:google_api, {
|
87
|
+
# :threshold => { :limit => 123, :period => 1.hour },
|
88
|
+
# :concurrency => { :limit => 10 }
|
89
|
+
# })
|
90
|
+
#
|
91
|
+
# Now we can assign it to our workers:
|
92
|
+
#
|
93
|
+
# class FetchProfileJob
|
94
|
+
# include Sidekiq::Job
|
95
|
+
# include Sidekiq::Throttled::Job
|
96
|
+
#
|
97
|
+
# sidekiq_throttle_as :google_api
|
98
|
+
# end
|
99
|
+
#
|
100
|
+
# class FetchCommentsJob
|
101
|
+
# include Sidekiq::Job
|
102
|
+
# include Sidekiq::Throttled::Job
|
103
|
+
#
|
104
|
+
# sidekiq_throttle_as :google_api
|
105
|
+
# end
|
106
|
+
#
|
107
|
+
# With the above configuration we ensure that there are maximum 10
|
108
|
+
# concurrently running jobs of FetchProfileJob or FetchCommentsJob
|
109
|
+
# allowed. And only 123 jobs of those are executed per hour.
|
110
|
+
#
|
111
|
+
# In other words, it will allow:
|
112
|
+
#
|
113
|
+
# - only `X` concurrent `FetchProfileJob`s
|
114
|
+
# - max `XX` `FetchProfileJob` per hour
|
115
|
+
# - only `Y` concurrent `FetchCommentsJob`s
|
116
|
+
# - max `YY` `FetchCommentsJob` per hour
|
117
|
+
#
|
118
|
+
# Where `(X + Y) == 10` and `(XX + YY) == 123`
|
119
|
+
#
|
120
|
+
# @see Registry.add_alias
|
121
|
+
# @return [void]
|
122
|
+
def sidekiq_throttle_as(name)
|
123
|
+
Registry.add_alias(self, name)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
@@ -12,8 +12,12 @@ module Sidekiq
|
|
12
12
|
|
13
13
|
def key(job_args)
|
14
14
|
key = @base_key.dup
|
15
|
-
key
|
16
|
-
|
15
|
+
return key unless @key_suffix
|
16
|
+
|
17
|
+
key << ":#{@key_suffix.call(*job_args)}"
|
18
|
+
rescue => e
|
19
|
+
Sidekiq.logger.error "Failed to get key suffix: #{e}"
|
20
|
+
raise e
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
@@ -37,7 +37,8 @@ module Sidekiq
|
|
37
37
|
percentile = 100.00 * int / max
|
38
38
|
lvl = if 80 <= percentile then "danger"
|
39
39
|
elsif 60 <= percentile then "warning"
|
40
|
-
else
|
40
|
+
else
|
41
|
+
"success"
|
41
42
|
end
|
42
43
|
|
43
44
|
%(<span class="label label-#{lvl}">#{int}</span>)
|
@@ -61,10 +62,10 @@ module Sidekiq
|
|
61
62
|
|
62
63
|
# @return [String]
|
63
64
|
def humanize_integer(int)
|
64
|
-
digits = int.to_s.
|
65
|
-
str = digits.shift(digits.count % 3).join
|
65
|
+
digits = int.to_s.chars
|
66
|
+
str = digits.shift(digits.count % 3).join
|
66
67
|
|
67
|
-
str << " " << digits.shift(3).join
|
68
|
+
str << " " << digits.shift(3).join while digits.count.positive?
|
68
69
|
|
69
70
|
str.strip
|
70
71
|
end
|
@@ -1,128 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
require "sidekiq/throttled/registry"
|
3
|
+
require "sidekiq/throttled/job"
|
5
4
|
|
6
5
|
module Sidekiq
|
7
6
|
module Throttled
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
|
13
|
-
# include Sidekiq::Worker
|
14
|
-
# include Sidekiq::Throttled::Worker
|
15
|
-
#
|
16
|
-
# sidkiq_options :queue => :my_queue
|
17
|
-
# sidekiq_throttle :threshold => { :limit => 123, :period => 1.hour }
|
18
|
-
#
|
19
|
-
# def perform
|
20
|
-
# # ...
|
21
|
-
# end
|
22
|
-
# end
|
23
|
-
#
|
24
|
-
# @see ClassMethods
|
25
|
-
module Worker
|
26
|
-
# Extends worker class with {ClassMethods}.
|
27
|
-
#
|
28
|
-
# @note Using `included` hook with extending worker with {ClassMethods}
|
29
|
-
# in order to make API inline with `include Sidekiq::Worker`.
|
30
|
-
#
|
31
|
-
# @private
|
32
|
-
def self.included(worker)
|
33
|
-
worker.send(:extend, ClassMethods)
|
34
|
-
end
|
35
|
-
|
36
|
-
# Helper methods added to the singleton class of destination
|
37
|
-
module ClassMethods
|
38
|
-
# Registers some strategy for the worker.
|
39
|
-
#
|
40
|
-
# @example Allow max 123 MyWorker jobs per hour
|
41
|
-
#
|
42
|
-
# class MyWorker
|
43
|
-
# include Sidekiq::Worker
|
44
|
-
# include Sidekiq::Throttled::Worker
|
45
|
-
#
|
46
|
-
# sidekiq_throttle({
|
47
|
-
# :threshold => { :limit => 123, :period => 1.hour }
|
48
|
-
# })
|
49
|
-
# end
|
50
|
-
#
|
51
|
-
# @example Allow max 10 concurrently running MyWorker jobs
|
52
|
-
#
|
53
|
-
# class MyWorker
|
54
|
-
# include Sidekiq::Worker
|
55
|
-
# include Sidekiq::Throttled::Worker
|
56
|
-
#
|
57
|
-
# sidekiq_throttle({
|
58
|
-
# :concurrency => { :limit => 10 }
|
59
|
-
# })
|
60
|
-
# end
|
61
|
-
#
|
62
|
-
# @example Allow max 10 concurrent MyWorker jobs and max 123 per hour
|
63
|
-
#
|
64
|
-
# class MyWorker
|
65
|
-
# include Sidekiq::Worker
|
66
|
-
# include Sidekiq::Throttled::Worker
|
67
|
-
#
|
68
|
-
# sidekiq_throttle({
|
69
|
-
# :threshold => { :limit => 123, :period => 1.hour },
|
70
|
-
# :concurrency => { :limit => 10 }
|
71
|
-
# })
|
72
|
-
# end
|
73
|
-
#
|
74
|
-
# @see Registry.add
|
75
|
-
# @return [void]
|
76
|
-
def sidekiq_throttle(**kwargs)
|
77
|
-
Registry.add(self, **kwargs)
|
78
|
-
end
|
79
|
-
|
80
|
-
# Adds current worker to preconfigured throttling strategy. Allows
|
81
|
-
# sharing same pool for multiple workers.
|
82
|
-
#
|
83
|
-
# First of all we need to create shared throttling strategy:
|
84
|
-
#
|
85
|
-
# # Create google_api throttling strategy
|
86
|
-
# Sidekiq::Throttled::Registry.add(:google_api, {
|
87
|
-
# :threshold => { :limit => 123, :period => 1.hour },
|
88
|
-
# :concurrency => { :limit => 10 }
|
89
|
-
# })
|
90
|
-
#
|
91
|
-
# Now we can assign it to our workers:
|
92
|
-
#
|
93
|
-
# class FetchProfileJob
|
94
|
-
# include Sidekiq::Worker
|
95
|
-
# include Sidekiq::Throttled::Worker
|
96
|
-
#
|
97
|
-
# sidekiq_throttle_as :google_api
|
98
|
-
# end
|
99
|
-
#
|
100
|
-
# class FetchCommentsJob
|
101
|
-
# include Sidekiq::Worker
|
102
|
-
# include Sidekiq::Throttled::Worker
|
103
|
-
#
|
104
|
-
# sidekiq_throttle_as :google_api
|
105
|
-
# end
|
106
|
-
#
|
107
|
-
# With the above configuration we ensure that there are maximum 10
|
108
|
-
# concurrently running jobs of FetchProfileJob or FetchCommentsJob
|
109
|
-
# allowed. And only 123 jobs of those are executed per hour.
|
110
|
-
#
|
111
|
-
# In other words, it will allow:
|
112
|
-
#
|
113
|
-
# - only `X` concurrent `FetchProfileJob`s
|
114
|
-
# - max `XX` `FetchProfileJob` per hour
|
115
|
-
# - only `Y` concurrent `FetchCommentsJob`s
|
116
|
-
# - max `YY` `FetchCommentsJob` per hour
|
117
|
-
#
|
118
|
-
# Where `(X + Y) == 10` and `(XX + YY) == 123`
|
119
|
-
#
|
120
|
-
# @see Registry.add_alias
|
121
|
-
# @return [void]
|
122
|
-
def sidekiq_throttle_as(name)
|
123
|
-
Registry.add_alias(self, name)
|
124
|
-
end
|
125
|
-
end
|
126
|
-
end
|
7
|
+
# A new module, Sidekiq::Job, was added in Sidekiq version 6.3.0 as a
|
8
|
+
# simple alias for Sidekiq::Worker as the term "worker" was considered
|
9
|
+
# too generic and confusing. Many people call a Sidekiq process a "worker"
|
10
|
+
# whereas others call the thread that executes jobs a "worker".
|
11
|
+
Worker = Job
|
127
12
|
end
|
128
13
|
end
|
data/lib/sidekiq/throttled.rb
CHANGED
@@ -9,6 +9,7 @@ require "sidekiq/throttled/communicator"
|
|
9
9
|
require "sidekiq/throttled/configuration"
|
10
10
|
require "sidekiq/throttled/queues_pauser"
|
11
11
|
require "sidekiq/throttled/registry"
|
12
|
+
require "sidekiq/throttled/job"
|
12
13
|
require "sidekiq/throttled/worker"
|
13
14
|
require "sidekiq/throttled/utils"
|
14
15
|
|
@@ -21,12 +22,12 @@ module Sidekiq
|
|
21
22
|
# require "sidekiq/throttled"
|
22
23
|
# Sidekiq::Throttled.setup!
|
23
24
|
#
|
24
|
-
# Once you've done that you can include {Sidekiq::Throttled::
|
25
|
+
# Once you've done that you can include {Sidekiq::Throttled::Job} to your
|
25
26
|
# job classes and configure throttling:
|
26
27
|
#
|
27
|
-
# class
|
28
|
-
# include Sidekiq::
|
29
|
-
# include Sidekiq::Throttled::
|
28
|
+
# class MyJob
|
29
|
+
# include Sidekiq::Job
|
30
|
+
# include Sidekiq::Throttled::Job
|
30
31
|
#
|
31
32
|
# sidekiq_options :queue => :my_queue
|
32
33
|
#
|
@@ -61,7 +62,7 @@ module Sidekiq
|
|
61
62
|
QueuesPauser.instance.setup!
|
62
63
|
|
63
64
|
Sidekiq.configure_server do |config|
|
64
|
-
setup_strategy!
|
65
|
+
setup_strategy!(config)
|
65
66
|
|
66
67
|
require "sidekiq/throttled/middleware"
|
67
68
|
config.server_middleware do |chain|
|
@@ -76,7 +77,7 @@ module Sidekiq
|
|
76
77
|
# @return [Boolean]
|
77
78
|
def throttled?(message)
|
78
79
|
message = JSON.parse message
|
79
|
-
job = message.fetch("class") { return false }
|
80
|
+
job = message.fetch("wrapped") { message.fetch("class") { return false } }
|
80
81
|
jid = message.fetch("jid") { return false }
|
81
82
|
|
82
83
|
preload_constant! job
|
@@ -93,15 +94,20 @@ module Sidekiq
|
|
93
94
|
private
|
94
95
|
|
95
96
|
# @return [void]
|
96
|
-
def setup_strategy!
|
97
|
+
def setup_strategy!(sidekiq_config)
|
97
98
|
require "sidekiq/throttled/fetch"
|
98
99
|
|
100
|
+
sidekiq_version = Gem::Version.new(Sidekiq::VERSION)
|
101
|
+
|
102
|
+
# https://github.com/mperham/sidekiq/commit/67daa7a408b214d593100f782271ed108686c147
|
103
|
+
sidekiq_config = sidekiq_config.options if sidekiq_version < Gem::Version.new("6.5.0")
|
104
|
+
|
99
105
|
# https://github.com/mperham/sidekiq/commit/fce05c9d4b4c0411c982078a4cf3a63f20f739bc
|
100
|
-
|
106
|
+
sidekiq_config[:fetch] =
|
101
107
|
if Gem::Version.new(Sidekiq::VERSION) < Gem::Version.new("6.1.0")
|
102
108
|
Sidekiq::Throttled::Fetch
|
103
109
|
else
|
104
|
-
Sidekiq::Throttled::Fetch.new(
|
110
|
+
Sidekiq::Throttled::Fetch.new(sidekiq_config)
|
105
111
|
end
|
106
112
|
end
|
107
113
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/sidekiq-throttled.gemspec
CHANGED
@@ -8,23 +8,25 @@ require "sidekiq/throttled/version"
|
|
8
8
|
Gem::Specification.new do |spec|
|
9
9
|
spec.name = "sidekiq-throttled"
|
10
10
|
spec.version = Sidekiq::Throttled::VERSION
|
11
|
-
spec.authors = ["Alexey
|
12
|
-
spec.email = ["
|
11
|
+
spec.authors = ["Alexey Zapparov"]
|
12
|
+
spec.email = ["alexey@zapparov.com"]
|
13
13
|
|
14
14
|
spec.summary = "Concurrency and threshold throttling for Sidekiq."
|
15
15
|
spec.description = "Concurrency and threshold throttling for Sidekiq."
|
16
|
-
spec.homepage = "https://github.com/
|
16
|
+
spec.homepage = "https://github.com/ixti/sidekiq-throttled"
|
17
17
|
spec.license = "MIT"
|
18
18
|
|
19
19
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
20
|
f.match %r{^(test|spec|features)/}
|
21
21
|
end
|
22
22
|
|
23
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
24
|
+
|
23
25
|
spec.bindir = "exe"
|
24
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
27
|
spec.require_paths = ["lib"]
|
26
28
|
|
27
|
-
spec.required_ruby_version = ">= 2.
|
29
|
+
spec.required_ruby_version = ">= 2.7"
|
28
30
|
|
29
31
|
spec.add_runtime_dependency "concurrent-ruby"
|
30
32
|
spec.add_runtime_dependency "redis-prescription"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-throttled
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Alexey
|
7
|
+
- Alexey Zapparov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -68,22 +68,17 @@ dependencies:
|
|
68
68
|
version: '2.0'
|
69
69
|
description: Concurrency and threshold throttling for Sidekiq.
|
70
70
|
email:
|
71
|
-
-
|
71
|
+
- alexey@zapparov.com
|
72
72
|
executables: []
|
73
73
|
extensions: []
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".coveralls.yml"
|
77
|
+
- ".github/dependabot.yml"
|
77
78
|
- ".github/workflows/ci.yml"
|
78
79
|
- ".gitignore"
|
79
80
|
- ".rspec"
|
80
81
|
- ".rubocop.yml"
|
81
|
-
- ".rubocop/layout.yml"
|
82
|
-
- ".rubocop/lint.yml"
|
83
|
-
- ".rubocop/metrics.yml"
|
84
|
-
- ".rubocop/performance.yml"
|
85
|
-
- ".rubocop/rspec.yml"
|
86
|
-
- ".rubocop/style.yml"
|
87
82
|
- ".rubocop_todo.yml"
|
88
83
|
- ".travis.yml"
|
89
84
|
- ".yardopts"
|
@@ -94,22 +89,23 @@ files:
|
|
94
89
|
- LICENSE.md
|
95
90
|
- README.md
|
96
91
|
- Rakefile
|
97
|
-
- gemfiles/sidekiq_5.0.gemfile
|
98
|
-
- gemfiles/sidekiq_5.1.gemfile
|
99
|
-
- gemfiles/sidekiq_5.2.gemfile
|
100
92
|
- gemfiles/sidekiq_6.0.gemfile
|
101
93
|
- gemfiles/sidekiq_6.1.gemfile
|
102
94
|
- gemfiles/sidekiq_6.2.gemfile
|
103
95
|
- gemfiles/sidekiq_6.3.gemfile
|
96
|
+
- gemfiles/sidekiq_6.4.gemfile
|
97
|
+
- gemfiles/sidekiq_6.5.gemfile
|
104
98
|
- lib/sidekiq/throttled.rb
|
105
99
|
- lib/sidekiq/throttled/communicator.rb
|
106
100
|
- lib/sidekiq/throttled/communicator/callbacks.rb
|
101
|
+
- lib/sidekiq/throttled/communicator/exception_handler.rb
|
107
102
|
- lib/sidekiq/throttled/communicator/listener.rb
|
108
103
|
- lib/sidekiq/throttled/configuration.rb
|
109
104
|
- lib/sidekiq/throttled/errors.rb
|
110
105
|
- lib/sidekiq/throttled/expirable_list.rb
|
111
106
|
- lib/sidekiq/throttled/fetch.rb
|
112
107
|
- lib/sidekiq/throttled/fetch/unit_of_work.rb
|
108
|
+
- lib/sidekiq/throttled/job.rb
|
113
109
|
- lib/sidekiq/throttled/middleware.rb
|
114
110
|
- lib/sidekiq/throttled/patches/queue.rb
|
115
111
|
- lib/sidekiq/throttled/queue_name.rb
|
@@ -132,11 +128,18 @@ files:
|
|
132
128
|
- lib/sidekiq/throttled/web/summary_fix.rb
|
133
129
|
- lib/sidekiq/throttled/web/throttled.html.erb
|
134
130
|
- lib/sidekiq/throttled/worker.rb
|
131
|
+
- rubocop/layout.yml
|
132
|
+
- rubocop/lint.yml
|
133
|
+
- rubocop/metrics.yml
|
134
|
+
- rubocop/performance.yml
|
135
|
+
- rubocop/rspec.yml
|
136
|
+
- rubocop/style.yml
|
135
137
|
- sidekiq-throttled.gemspec
|
136
|
-
homepage: https://github.com/
|
138
|
+
homepage: https://github.com/ixti/sidekiq-throttled
|
137
139
|
licenses:
|
138
140
|
- MIT
|
139
|
-
metadata:
|
141
|
+
metadata:
|
142
|
+
rubygems_mfa_required: 'true'
|
140
143
|
post_install_message:
|
141
144
|
rdoc_options: []
|
142
145
|
require_paths:
|
@@ -145,14 +148,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
148
|
requirements:
|
146
149
|
- - ">="
|
147
150
|
- !ruby/object:Gem::Version
|
148
|
-
version: '2.
|
151
|
+
version: '2.7'
|
149
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
153
|
requirements:
|
151
154
|
- - ">="
|
152
155
|
- !ruby/object:Gem::Version
|
153
156
|
version: '0'
|
154
157
|
requirements: []
|
155
|
-
rubygems_version: 3.
|
158
|
+
rubygems_version: 3.1.6
|
156
159
|
signing_key:
|
157
160
|
specification_version: 4
|
158
161
|
summary: Concurrency and threshold throttling for Sidekiq.
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# This file was generated by Appraisal
|
2
|
-
|
3
|
-
source "https://rubygems.org"
|
4
|
-
|
5
|
-
gem "appraisal"
|
6
|
-
gem "rake"
|
7
|
-
gem "rspec"
|
8
|
-
gem "rubocop", "~> 0.90.0", require: false
|
9
|
-
gem "rubocop-performance", "~> 1.8.0", require: false
|
10
|
-
gem "rubocop-rspec", "~> 1.43.2", require: false
|
11
|
-
gem "sidekiq", "~> 5.0.0"
|
12
|
-
|
13
|
-
group :development do
|
14
|
-
gem "byebug"
|
15
|
-
gem "guard", require: false
|
16
|
-
gem "guard-rspec", require: false
|
17
|
-
gem "guard-rubocop", require: false
|
18
|
-
end
|
19
|
-
|
20
|
-
group :test do
|
21
|
-
gem "apparition"
|
22
|
-
gem "capybara"
|
23
|
-
gem "coveralls", require: false
|
24
|
-
gem "puma"
|
25
|
-
gem "rack-test"
|
26
|
-
gem "simplecov"
|
27
|
-
gem "sinatra"
|
28
|
-
gem "timecop"
|
29
|
-
end
|
30
|
-
|
31
|
-
gemspec path: "../"
|