sidekiq-tool 0.0.2 → 0.0.3
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/README.md +36 -37
- data/Rakefile +13 -1
- data/exe/sidekiq-tool +18 -7
- data/lib/sidekiq/tool/version.rb +1 -1
- data/sidekiq-tool.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffdeb6586c2b5a444a8a5de99a04749fd4c6008596660ba21bdb7ce56a63fc28
|
4
|
+
data.tar.gz: e9aacdc874d53fc18b07600acfccd1177bcdba67a706a094025130dfe761e170
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b8a68f8924fede629c26c34f91ad3b6b95d591e0ed0a33753fbd0ab28d9e655513cfe78bc8025f4543b18f06baca47b7ba5fc3db43faf9a505a276dbce63f92
|
7
|
+
data.tar.gz: 17bcf75c93f047c06192cc06ec2414164b8dd1eaecd1f188f2020ccad3bddaaeba35ecb96e31286ca495e2ea896426178c4d848d7d33bd8707f7f117dc945895
|
data/README.md
CHANGED
@@ -1,37 +1,36 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
Everyone interacting in the Sidekiq::Tool project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/zed-0xff/sidekiq-tool/blob/master/CODE_OF_CONDUCT.md).
|
1
|
+
# sidekiq-tool
|
2
|
+
|
3
|
+
```
|
4
|
+
Usage: sidekiq-tool [options]
|
5
|
+
-u URL Redis URL (default: from REDIS_URL env var)
|
6
|
+
-q, --queue QUEUE apply next commands to specified queue
|
7
|
+
--jid JID (alias for --job-id)
|
8
|
+
--job-id JID (can be used multiple times)
|
9
|
+
--job-class CLASS (can be used multiple times)
|
10
|
+
|
11
|
+
-l, --list list queues (default)
|
12
|
+
-s, --show [RANGE] show contents of queue
|
13
|
+
see https://redis.io/commands/lrange/
|
14
|
+
-S, --schedule show scheduled jobs (respects queue parameter)
|
15
|
+
-P, --processes show processes (respects queue parameter)
|
16
|
+
-R, --running-jobs show currently running jobs (respects queue/jid/job-class)
|
17
|
+
|
18
|
+
--import-jobs add jobs from STDIN into queue
|
19
|
+
--move-jobs [N] atomically move jobs to another queue
|
20
|
+
-Q, --dst-queue QUEUE destination queue
|
21
|
+
|
22
|
+
Destructive commands: (require confirmations)
|
23
|
+
--delete-jobs [N] N limits number of jobs to delete, 0 (default) = delete all
|
24
|
+
respects --job-id and --job-class parameters
|
25
|
+
--export-jobs [N] same as delete, but job data is written to STDOUT beforehead
|
26
|
+
--delete-queue deletes ALL jobs from queue
|
27
|
+
|
28
|
+
--confirm-delete-jobs jobs will not be deleted without this option
|
29
|
+
--confirm-export-jobs
|
30
|
+
--confirm-queue-delete queue will not be deleted without this option
|
31
|
+
|
32
|
+
-W, --omit-weight Omit weight from schedule output (easier to parse)
|
33
|
+
-v, --[no-]verbose Run verbosely
|
34
|
+
-k Bypass SSL verification (for debug/dev)
|
35
|
+
|
36
|
+
```
|
data/Rakefile
CHANGED
@@ -5,4 +5,16 @@ require "rubocop/rake_task"
|
|
5
5
|
|
6
6
|
RuboCop::RakeTask.new
|
7
7
|
|
8
|
-
task default:
|
8
|
+
task default: %i[readme rubocop]
|
9
|
+
|
10
|
+
desc "update readme"
|
11
|
+
task :readme do
|
12
|
+
data = []
|
13
|
+
data << "# sidekiq-tool"
|
14
|
+
data << ""
|
15
|
+
data << "```"
|
16
|
+
data << `./exe/sidekiq-tool`
|
17
|
+
data << "```"
|
18
|
+
|
19
|
+
File.write "README.md", data.join("\n")
|
20
|
+
end
|
data/exe/sidekiq-tool
CHANGED
@@ -47,13 +47,16 @@ optparse = OptionParser.new do |opts|
|
|
47
47
|
@commands << [:show, v || "0..-1"]
|
48
48
|
end
|
49
49
|
|
50
|
-
opts.on("-S", "--schedule", "show scheduled jobs (respects queue parameter)") do
|
51
|
-
@commands << [:schedule]
|
52
|
-
end
|
53
50
|
opts.on("-P", "--processes", "show processes (respects queue parameter)") do
|
54
51
|
@commands << [:processes]
|
55
52
|
end
|
56
|
-
opts.on("-R", "--
|
53
|
+
opts.on("-R", "--retries", "show retries (respects queue parameter)") do
|
54
|
+
@commands << [:retries]
|
55
|
+
end
|
56
|
+
opts.on("-S", "--scheduled", "show scheduled jobs (respects queue parameter)") do
|
57
|
+
@commands << [:scheduled]
|
58
|
+
end
|
59
|
+
opts.on("-r", "--running-jobs", "show currently running jobs (respects queue/jid/job-class)") do
|
57
60
|
@commands << [:jobs]
|
58
61
|
end
|
59
62
|
|
@@ -98,7 +101,7 @@ optparse = OptionParser.new do |opts|
|
|
98
101
|
|
99
102
|
opts.separator("")
|
100
103
|
|
101
|
-
opts.on("-W", "--omit-weight", "Omit weight from schedule output (easier to parse)") do
|
104
|
+
opts.on("-W", "--omit-weight", "Omit weight from schedule/retries output (easier to parse)") do
|
102
105
|
@options[:omit_weight] = true
|
103
106
|
end
|
104
107
|
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
|
@@ -205,7 +208,7 @@ def move_jobs(n)
|
|
205
208
|
end
|
206
209
|
|
207
210
|
# can optionally accept queue/job_class/jid
|
208
|
-
def
|
211
|
+
def _zscan(zkey)
|
209
212
|
match = []
|
210
213
|
match << %("queue":"#{@options[:queue]}") if @options[:queue]
|
211
214
|
if @options[:job_class].size == 1
|
@@ -219,7 +222,7 @@ def schedule
|
|
219
222
|
raise "multiple job ids filter TBD"
|
220
223
|
end
|
221
224
|
match = match.any? ? "*#{match.join("*")}*" : nil
|
222
|
-
@redis.zscan_each(
|
225
|
+
@redis.zscan_each(zkey, count: 1000, match: match).each do |sdata, weight|
|
223
226
|
if @options[:omit_weight]
|
224
227
|
puts sdata
|
225
228
|
else
|
@@ -228,6 +231,14 @@ def schedule
|
|
228
231
|
end
|
229
232
|
end
|
230
233
|
|
234
|
+
def scheduled
|
235
|
+
_zscan("schedule")
|
236
|
+
end
|
237
|
+
|
238
|
+
def retries
|
239
|
+
_zscan("retry")
|
240
|
+
end
|
241
|
+
|
231
242
|
# slowest!
|
232
243
|
def processes
|
233
244
|
@redis.smembers("processes").each do |pid|
|
data/lib/sidekiq/tool/version.rb
CHANGED
data/sidekiq-tool.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = "sidekiq-tool"
|
7
7
|
spec.version = Sidekiq::Tool::VERSION
|
8
8
|
spec.authors = ["Andrey \"Zed\" Zaikin"]
|
9
|
-
spec.email = ["
|
9
|
+
spec.email = ["zed.0xff@gmail.com"]
|
10
10
|
|
11
11
|
spec.summary = "swiss-army knife for tinkering with sidekiq guts"
|
12
12
|
spec.homepage = "https://github.com/zed-0xff/sidekiq-tool"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey "Zed" Zaikin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
version: '0'
|
27
27
|
description:
|
28
28
|
email:
|
29
|
-
-
|
29
|
+
- zed.0xff@gmail.com
|
30
30
|
executables:
|
31
31
|
- sidekiq-tool
|
32
32
|
extensions: []
|