sidekiq_toolbelt 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -4
- data/lib/sidekiq_toolbelt.rb +4 -3
- data/lib/sidekiq_toolbelt/version.rb +1 -1
- data/sidekiq_toolbelt.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f190c0a217eed876f4a50fef4716649dc8a05c22
|
4
|
+
data.tar.gz: 0be3b9281a865acee3168f44bc85177ac9b92d11
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa2016431fc89b7b31fb5623554d5990cf69bafdb8ba6c69d726c281114711066af531992fb0bf03fab9a9a57fe4184775af238336a6b941e021e5c8f3762713
|
7
|
+
data.tar.gz: fda8ff482ff4fb2c0ca99ee52f2e69a1050eb2129d6fcb2f720480671710bef6898468273f9925582f2b858e2c63b1deb943ab8133ec677eb07eea7b0fc5c59c
|
data/README.md
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sidekiq_toolbelt`. To experiment with that code, run `bin/console` for an interactive prompt.
|
1
|
+
# Sidekiq Toolbelt
|
4
2
|
|
5
3
|
## Installation
|
6
4
|
|
@@ -20,7 +18,19 @@ Or install it yourself as:
|
|
20
18
|
|
21
19
|
## Usage
|
22
20
|
|
23
|
-
|
21
|
+
This library is meant to be used along with `Sidekiq`, probably from a Rails console.
|
22
|
+
|
23
|
+
`SidekiqToolbelt.counts` or `SidekiqToolbelt.counts(queue: :important)` will print job counts.
|
24
|
+
|
25
|
+
`SidekiqToolbelt.kill('User::SignupEmail')` or `SidekiqToolbelt.kill('User::SignupEmail', queue: :important)` will kill a job by class.
|
26
|
+
|
27
|
+
`SidekiqToolbelt.kill('Net::HTTPForbidden')` or `SidekiqToolbelt.kill('Net::HTTPForbidden', queue: :important)` will kill a job by error.
|
28
|
+
|
29
|
+
`SidekiqToolbelt.kill_retries('User::SignupEmail')` will kill a rescheduled job by class.
|
30
|
+
|
31
|
+
`SidekiqToolbelt.kill_retries_by_error('Net::HTTPForbidden')` will kill a rescheduled job by error.
|
32
|
+
|
33
|
+
`SidekiqToolbelt.clear('User::SignupEmail')` or `SidekiqToolbelt.clear('User::SignupEmail', 'User::SubscriptionJob', queue: :important)` will continuously delete jobs to keep the queue clear.
|
24
34
|
|
25
35
|
## Development
|
26
36
|
|
data/lib/sidekiq_toolbelt.rb
CHANGED
@@ -13,7 +13,7 @@ module SidekiqToolbelt
|
|
13
13
|
counts[job.klass] += 1
|
14
14
|
end
|
15
15
|
end
|
16
|
-
|
16
|
+
|
17
17
|
pp counts.sort_by {|k,v| -v}.to_h
|
18
18
|
end
|
19
19
|
|
@@ -41,11 +41,12 @@ module SidekiqToolbelt
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
def clear(*jobs)
|
44
|
+
def clear(*jobs, queue: :default)
|
45
45
|
loop do
|
46
|
+
# update and reuse #kill?
|
46
47
|
Sidekiq::Queue.new(:default).each do |job|
|
47
48
|
if jobs.include? job.klass
|
48
|
-
job.delete
|
49
|
+
job.delete
|
49
50
|
end
|
50
51
|
end
|
51
52
|
puts 'clearing...'
|
data/sidekiq_toolbelt.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Scott Albertson"]
|
10
10
|
spec.email = ["ascottalbertson@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
spec.description = %q{
|
12
|
+
spec.summary = %q{Sidekiq helpers for console}
|
13
|
+
spec.description = %q{A collection of methods to monitor, delete and clear Sidekiq jobs.}
|
14
14
|
spec.homepage = "https://github.com/salbertson/sidekiq_toolbelt"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq_toolbelt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Albertson
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '5.0'
|
55
|
-
description:
|
55
|
+
description: A collection of methods to monitor, delete and clear Sidekiq jobs.
|
56
56
|
email:
|
57
57
|
- ascottalbertson@gmail.com
|
58
58
|
executables: []
|
@@ -93,5 +93,5 @@ rubyforge_project:
|
|
93
93
|
rubygems_version: 2.6.11
|
94
94
|
signing_key:
|
95
95
|
specification_version: 4
|
96
|
-
summary:
|
96
|
+
summary: Sidekiq helpers for console
|
97
97
|
test_files: []
|