sidekiq-clutch 2.1.2 → 3.0.0
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 +4 -4
- data/.circleci/config.yml +1 -2
- data/.envrc +6 -0
- data/CHANGELOG.md +6 -0
- data/devbox.json +14 -0
- data/devbox.lock +73 -0
- data/lib/sidekiq/clutch/version.rb +1 -1
- data/lib/sidekiq/clutch.rb +0 -18
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1aeadb1bf712264c64a2770ac20cfcf779af8ab29ed120b40dd1730e30b28d0
|
|
4
|
+
data.tar.gz: 3cda98c60d5bb023b220320ea11a15e941ede2bf44df4625677e7950286a2176
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2b2e5468e6162b849245fbdba40fda75e96de6ad91757aba4cdc537ef7d5188a5abdcd37163d38f0e3c1b44dc2610654e14145cf0cebebec17f0bbfd1f238ad2
|
|
7
|
+
data.tar.gz: 8e10d8416293f4ef95df375612b8dbd9b023fae01301e90e2c229f4522125b4ddd8cd50f281f4bcc15e6a6f2af8d6c7f47fe1eafc293024655320901b4ec8b16
|
data/.circleci/config.yml
CHANGED
|
@@ -4,10 +4,9 @@ jobs:
|
|
|
4
4
|
parallelism: 1
|
|
5
5
|
docker:
|
|
6
6
|
- image: cimg/ruby:3.3
|
|
7
|
-
- image: redis:
|
|
7
|
+
- image: redis:8.0-M03-alpine
|
|
8
8
|
steps:
|
|
9
9
|
- checkout
|
|
10
|
-
- run: sed -i "s/spec.add_dependency 'sidekiq', '>= 5.0.0'/spec.add_dependency 'sidekiq', '>= 5.0.0', '< 7.0.0'/" sidekiq-clutch.gemspec
|
|
11
10
|
- run: gem install bundler
|
|
12
11
|
- run: bundle install
|
|
13
12
|
- run: bundle exec rspec
|
data/.envrc
ADDED
data/CHANGELOG.md
CHANGED
data/devbox.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.14.0/.schema/devbox.schema.json",
|
|
3
|
+
"packages": ["ruby_3_3@latest"],
|
|
4
|
+
"shell": {
|
|
5
|
+
"init_hook": [
|
|
6
|
+
"echo 'Welcome to devbox!' > /dev/null"
|
|
7
|
+
],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"test": [
|
|
10
|
+
"echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
data/devbox.lock
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lockfile_version": "1",
|
|
3
|
+
"packages": {
|
|
4
|
+
"github:NixOS/nixpkgs/nixpkgs-unstable": {
|
|
5
|
+
"resolved": "github:NixOS/nixpkgs/632f04521e847173c54fa72973ec6c39a371211c?lastModified=1739863612&narHash=sha256-UbtgxplOhFcyjBcNbTVO8%2BHUHAl%2FWXFDOb6LvqShiZo%3D"
|
|
6
|
+
},
|
|
7
|
+
"ruby_3_3@latest": {
|
|
8
|
+
"last_modified": "2024-09-10T15:01:03Z",
|
|
9
|
+
"plugin_version": "0.0.2",
|
|
10
|
+
"resolved": "github:NixOS/nixpkgs/5ed627539ac84809c78b2dd6d26a5cebeb5ae269#ruby",
|
|
11
|
+
"source": "devbox-search",
|
|
12
|
+
"version": "3.3.4",
|
|
13
|
+
"systems": {
|
|
14
|
+
"aarch64-darwin": {
|
|
15
|
+
"outputs": [
|
|
16
|
+
{
|
|
17
|
+
"name": "out",
|
|
18
|
+
"path": "/nix/store/zsngi7cq7asxc6kb0lcmbyydasfrmai6-ruby-3.3.4",
|
|
19
|
+
"default": true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "devdoc",
|
|
23
|
+
"path": "/nix/store/c0zmjmfw5pp00slwy842bd8zzy74pava-ruby-3.3.4-devdoc"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"store_path": "/nix/store/zsngi7cq7asxc6kb0lcmbyydasfrmai6-ruby-3.3.4"
|
|
27
|
+
},
|
|
28
|
+
"aarch64-linux": {
|
|
29
|
+
"outputs": [
|
|
30
|
+
{
|
|
31
|
+
"name": "out",
|
|
32
|
+
"path": "/nix/store/8vri7d6b75gspvnfrdpqnagfi5bbvis9-ruby-3.3.4",
|
|
33
|
+
"default": true
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "devdoc",
|
|
37
|
+
"path": "/nix/store/bfrwr1n6pxd3hz31h589j317g290p0r5-ruby-3.3.4-devdoc"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"store_path": "/nix/store/8vri7d6b75gspvnfrdpqnagfi5bbvis9-ruby-3.3.4"
|
|
41
|
+
},
|
|
42
|
+
"x86_64-darwin": {
|
|
43
|
+
"outputs": [
|
|
44
|
+
{
|
|
45
|
+
"name": "out",
|
|
46
|
+
"path": "/nix/store/hksac0axpx3savrgmy75rid3smv0d9nj-ruby-3.3.4",
|
|
47
|
+
"default": true
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"name": "devdoc",
|
|
51
|
+
"path": "/nix/store/3564jxjgp9dk8vzjwb7i3fpzkpw74z3m-ruby-3.3.4-devdoc"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"store_path": "/nix/store/hksac0axpx3savrgmy75rid3smv0d9nj-ruby-3.3.4"
|
|
55
|
+
},
|
|
56
|
+
"x86_64-linux": {
|
|
57
|
+
"outputs": [
|
|
58
|
+
{
|
|
59
|
+
"name": "out",
|
|
60
|
+
"path": "/nix/store/2vg3asd3rmhng3wqvp781a1q5dhrr4yn-ruby-3.3.4",
|
|
61
|
+
"default": true
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "devdoc",
|
|
65
|
+
"path": "/nix/store/2vgrf69lcz8ipawxipza3w7gsqdnbbnk-ruby-3.3.4-devdoc"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"store_path": "/nix/store/2vg3asd3rmhng3wqvp781a1q5dhrr4yn-ruby-3.3.4"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
data/lib/sidekiq/clutch.rb
CHANGED
|
@@ -72,8 +72,6 @@ module Sidekiq
|
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
def on_success(status, options)
|
|
75
|
-
return on_success_legacy(status, options) if options['jobs']
|
|
76
|
-
|
|
77
75
|
raise 'invariant: key_base is missing!' unless options['key_base']
|
|
78
76
|
raise 'invariant: result_key_index is missing!' unless options['result_key_index']
|
|
79
77
|
|
|
@@ -101,20 +99,6 @@ module Sidekiq
|
|
|
101
99
|
|
|
102
100
|
private
|
|
103
101
|
|
|
104
|
-
# accept old style of passing job data, will be removed in 3.0
|
|
105
|
-
def on_success_legacy(status, options)
|
|
106
|
-
@key_base = options['result_key'].sub(/-\d+$/, '')
|
|
107
|
-
if options['jobs'].empty?
|
|
108
|
-
clean_up_temporary_keys
|
|
109
|
-
return
|
|
110
|
-
end
|
|
111
|
-
parent_batch = Sidekiq::Batch.new(status.parent_bid)
|
|
112
|
-
service = self.class.new(parent_batch)
|
|
113
|
-
service.jobs.raw = options['jobs']
|
|
114
|
-
service.current_result_key = options['result_key']
|
|
115
|
-
service.engage
|
|
116
|
-
end
|
|
117
|
-
|
|
118
102
|
def key_base
|
|
119
103
|
@key_base ||= "clutch:#{SecureRandom.uuid}"
|
|
120
104
|
end
|
|
@@ -146,8 +130,6 @@ module Sidekiq
|
|
|
146
130
|
def result_key_index(step)
|
|
147
131
|
if step['result_key_index']
|
|
148
132
|
step['result_key_index']
|
|
149
|
-
elsif step['result_key'] # legacy style, will be removed in 3.0
|
|
150
|
-
step['result_key'].split('-').last.to_i
|
|
151
133
|
else
|
|
152
134
|
raise "invariant: expected result_key_index passed in step; got: #{step.inspect}"
|
|
153
135
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: sidekiq-clutch
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Morgan
|
|
@@ -61,6 +61,7 @@ extensions: []
|
|
|
61
61
|
extra_rdoc_files: []
|
|
62
62
|
files:
|
|
63
63
|
- ".circleci/config.yml"
|
|
64
|
+
- ".envrc"
|
|
64
65
|
- ".gitignore"
|
|
65
66
|
- ".rspec"
|
|
66
67
|
- ".rubocop.yml"
|
|
@@ -69,6 +70,8 @@ files:
|
|
|
69
70
|
- LICENSE.txt
|
|
70
71
|
- README.md
|
|
71
72
|
- Rakefile
|
|
73
|
+
- devbox.json
|
|
74
|
+
- devbox.lock
|
|
72
75
|
- lib/sidekiq/clutch.rb
|
|
73
76
|
- lib/sidekiq/clutch/job_wrapper.rb
|
|
74
77
|
- lib/sidekiq/clutch/jobs_collection.rb
|