sidekiq-grouping 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9c96db0ae5af0c9a398f9e2a0718b55ede63741
4
- data.tar.gz: 69adc754a26f5d4ba89f876f5e39803ba06d7e1f
3
+ metadata.gz: 42ade6a2a9e5a211f91f65d138add7f4cbeaeef8
4
+ data.tar.gz: a230dcc8364303f18e45920294ca9f8c5a5b8895
5
5
  SHA512:
6
- metadata.gz: 80ae9e4599902073a2fd7336622f9b15b59f8cd3da25121b6d319dd2cb71f2aa2df56d9e14dbfe682f7b5b1d6d806c90a73cbaadd68f28bcf6f1e1655fa736aa
7
- data.tar.gz: 086a0e13a585b06858d34752866099c9efa914139decaac83832dca5571d048ef8532a48cfe0395a92370f4c3554643afcb0f7a93d2330ab0fb517c757deae86
6
+ metadata.gz: 8ebcd0fa5c6ec5c6b9428836547c8036db3eb8093567f47830790e1bd2d90622085f17fe10d42a2a35e3d08b06520c90e35f45060be37ec60f7c7dd3f89698a9
7
+ data.tar.gz: 58a8742715f73757ef98f881df956022ee8341f7bbffb2d724eefbbd345866a5ae6433d07dbc354e0ebdd624459228b36ed884ff93c8f4c663841af421eb74d1
data/README.md CHANGED
@@ -123,12 +123,25 @@ require "sidekiq/grouping/web"
123
123
 
124
124
  ## Configuration
125
125
 
126
+ Specify grouping configuration inside of sidekiq.yml:
127
+
128
+ ```yml
129
+ grouping:
130
+ :poll_interval: 5 # Amount of time between polling batches
131
+ :max_batch_size: 5000 # Maximum batch size allowed
132
+ :lock_ttl: 1 # Batch queue flush lock timeout job enqueues
133
+ ```
134
+
135
+ Or set it in your code:
136
+
126
137
  ```ruby
127
- Sidekiq::Grouping::Config.poll_interval = 5 # Amount of time between polling batches
128
- Sidekiq::Grouping::Config.max_batch_size = 5000 # Maximum batch size allowed
129
- Sidekiq::Grouping::Config.lock_ttl = 1 # Batch queue flush lock timeout job enqueues
138
+ Sidekiq::Grouping::Config.poll_interval = 5
139
+ Sidekiq::Grouping::Config.max_batch_size = 5000
140
+ Sidekiq::Grouping::Config.lock_ttl = 1
130
141
  ```
131
142
 
143
+ Note that you should set poll_interval option inside of sidekiq.yml to take effect. Setting this param in your ruby code won't change actual polling frequency.
144
+
132
145
  ## TODO
133
146
 
134
147
  1. Add support redis_pool option.
@@ -1,15 +1,22 @@
1
1
  module Sidekiq::Grouping::Config
2
2
  include ActiveSupport::Configurable
3
3
 
4
+ def self.options
5
+ Sidekiq.options["grouping"] || {}
6
+ end
7
+
4
8
  # Queue size overflow check polling interval
5
- config_accessor :poll_interval
6
- config.poll_interval = 3
9
+ config_accessor :poll_interval do
10
+ options[:poll_interval] || 3
11
+ end
7
12
 
8
13
  # Maximum batch size
9
- config_accessor :max_batch_size
10
- config.max_batch_size = 1000
14
+ config_accessor :max_batch_size do
15
+ options[:max_batch_size] || 1000
16
+ end
11
17
 
12
18
  # Batch queue flush lock timeout
13
- config_accessor :lock_ttl
14
- config.lock_ttl = 1
19
+ config_accessor :lock_ttl do
20
+ options[:lock_ttl] || 1
21
+ end
15
22
  end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Grouping
3
- VERSION = "1.0.8"
3
+ VERSION = "1.0.9 "
4
4
  end
5
5
  end
@@ -11,11 +11,11 @@ module Sidekiq
11
11
  erb File.read(File.join(VIEWS, 'index.erb')), locals: {view_path: VIEWS}
12
12
  end
13
13
 
14
- app.post "/grouping/*/delete" do |name|
15
- worker_class, queue = Sidekiq::Grouping::Batch.extract_worker_klass_and_queue(name)
14
+ app.post "/grouping/:name/delete" do
15
+ worker_class, queue = Sidekiq::Grouping::Batch.extract_worker_klass_and_queue(params['name'])
16
16
  batch = Sidekiq::Grouping::Batch.new(worker_class, queue)
17
17
  batch.delete
18
- redirect "#{root_path}/grouping"
18
+ redirect "#{root_path}grouping"
19
19
  end
20
20
  end
21
21
 
@@ -25,4 +25,3 @@ end
25
25
 
26
26
  Sidekiq::Web.register(Sidekiq::Grouping::Web)
27
27
  Sidekiq::Web.tabs["Grouping"] = "grouping"
28
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-grouping
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Sokolov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-12 00:00:00.000000000 Z
11
+ date: 2017-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.5.1
189
+ rubygems_version: 2.6.12
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: Allows identical sidekiq jobs to be processed with a single background call