sidekiq-status 1.1.2 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 328bd95affe0aa84cd7c797f63ba97b3d93a7d60fa003d75ede0e9996b88c399
4
- data.tar.gz: db96de58b9b6e45f5ec0ecc600839778b82c4956ce43de7af55fafe42478af10
3
+ metadata.gz: 3e44ab90955a60880c79cadc648a5c9883e635faf6b5439093830bb138f0309c
4
+ data.tar.gz: 4b61eefa63d54d14d8183616b5cb3806b13e234d810ee67a8fb0519614ac97d9
5
5
  SHA512:
6
- metadata.gz: 8bfe5b5a0f8566f64d3778dff4f4a923103da2fb0926c4a43eb7677b689d3898641c2c0d53438cd88f8f72c1bd6bfa1e6db60326fed08cb953ede14ec7bc43d3
7
- data.tar.gz: ba8f04547ff36c3c77c6cffd75f92f908afb7dd13291eaf454838a48d5a19014d6fb8e8a3fe663f6802e496e2a60588c64e477bbda97a504dd8936f8a0c37d7a
6
+ metadata.gz: 874e1d6ceeb732aaab70c95ae1b41f78c1422a2da3f93e947b3ef353d558f9b51dd4dc395b3a5d7a19ee3b4560c509768e20dcb5faa9418ee344423b3c12412f
7
+ data.tar.gz: fc8e8e604ba7fecea63d13933bd6cf8a0aa9232de253bc015244fe9f0b7c5b81dcedd457db9fc409d515b2a76c222e89d0124547bf33505a710cfdb740ba2119
data/.gitignore CHANGED
@@ -4,6 +4,7 @@ gemfiles/*.lock
4
4
  .bundle
5
5
  .config
6
6
  .rvmrc
7
+ .ruby-version
7
8
  .yardoc
8
9
  Gemfile.lock
9
10
  InstalledFiles
data/.travis.yml CHANGED
@@ -1,14 +1,12 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.3
4
- - 2.4
5
- - 2.5
6
3
  - 2.6
4
+ - 2.7
5
+ - 3.0
7
6
  - ruby-head
8
7
  gemfile:
9
- - gemfiles/sidekiq_3.x.gemfile
10
- - gemfiles/sidekiq_4.x.gemfile
11
8
  - gemfiles/sidekiq_5.x.gemfile
9
+ - gemfiles/sidekiq_6.x.gemfile
12
10
  before_install:
13
11
  - gem update --system
14
12
  - gem update bundler
data/Appraisals CHANGED
@@ -1,11 +1,7 @@
1
- appraise "sidekiq-3.x" do
2
- gem "sidekiq", "~> 3"
3
- end
4
-
5
- appraise "sidekiq-4.x" do
6
- gem "sidekiq", "~> 4"
7
- end
8
-
9
1
  appraise "sidekiq-5.x" do
10
2
  gem "sidekiq", "~> 5"
11
3
  end
4
+
5
+ appraise "sidekiq-6.x" do
6
+ gem "sidekiq", "~> 6"
7
+ end
data/CHANGELOG.md CHANGED
@@ -1,65 +1,12 @@
1
- **Version 1.1.2**
2
- * Job detail pages now show custom data keys (#139)
1
+ **Version 2.0.1**
2
+ * Adds support for dark mode to the job status page
3
3
 
4
- **Version 1.1.1**
5
- * Uses SCAN rather than KEYS when retrieving job ids from Redis (#139)
4
+ **Version 2.0.0**
5
+ * Adds support for Ruby 2.7, 3.0
6
+ * Adds support for Sidekiq 6.x
7
+ * Removes support for Ruby 2.3, 2.4, 2.5
8
+ * Removes support for Sidekiq 3.x, 4.x
6
9
 
7
- **Version 1.1.0**
8
- + Fixes the use case of multiple services sharing the same Redis instance (#135)
10
+ **Versions 1.1.4 and prior**
9
11
 
10
- **Version 1.0.2**
11
- + Fixes status not being set to `:failed` after retries
12
-
13
- **Version 1.0.1**
14
- + Fixes namespacing in `sidekiq-status/testing/inline`
15
-
16
- **Version 1.0.0**
17
- + Version number bumped to indicate stable release
18
-
19
- **Version 0.8.1**
20
- + Avoids transient celluloid dependency in Sidekiq < 5.x
21
-
22
- **Version 0.8.0**
23
- + Properly ignores jobs that do not have `Sidekiq::Status::Worker` included
24
- + Honors custom job expirations for ActiveJob jobs
25
- + Adds a `:retrying` status
26
- + Adds remove / retry buttons to the index page
27
- + Server middleware will now catches all exception types
28
- + Changes where server middleware is inserted in the chain
29
- + Reduces the amount of Redis calls made
30
- + Adds pagination / per page setting
31
- + Restores column sorting functionality
32
-
33
- **Version 0.7.0**
34
- + Sidekiq 4.2 and 5 now supported
35
- + Added full support for ActiveJob
36
- + Updated Web UI
37
- + Styling updated to stay consistent with Sidekiq UI
38
- + Added header sorting
39
- + Fixed argument formatting
40
- + Times now display using natural language via ChronicDuration
41
- + Test suite fixed
42
-
43
- **Version 0.6.0**
44
- + Updated Web UI
45
- + Will have all job statuses, previously it was showing only :working status
46
- + Bootstrap labels instead of badges for status
47
- + Added Arguments column to statuses page
48
- + New :interrupted status added
49
- + Added way to specify :expiration for Sidekiq::Status::ClientMiddleware
50
- + Bug fixes & Code cleanup
51
-
52
- **Version 0.5.3**
53
- + some tweaks in web UI, separate Redis namespace
54
-
55
- **Version 0.5.2**
56
- + Sidekiq versions up to 3.3.* supported, jobs sorting options in web UI, more ruby versions
57
-
58
- **Version 0.5.1**
59
- + dependencies versions requirements relaxed
60
-
61
- **Version 0.5.0**
62
- + Sidekiq v3 support, Redis pools support
63
-
64
- **Version 0.4.0**
65
- + WebUI added, per-worker expiration setting enabled
12
+ See https://github.com/utgarda/sidekiq-status/blob/master/CHANGELOG.md.
data/README.md CHANGED
@@ -1,16 +1,11 @@
1
1
  # Sidekiq::Status
2
- [![Gem Version](https://badge.fury.io/rb/sidekiq-status.svg)](http://badge.fury.io/rb/sidekiq-status)
3
- [![Code Climate](https://codeclimate.com/github/utgarda/sidekiq-status.svg)](https://codeclimate.com/github/utgarda/sidekiq-status)
4
- [![Build Status](https://secure.travis-ci.org/utgarda/sidekiq-status.svg)](http://travis-ci.org/utgarda/sidekiq-status)
5
- [![Dependency Status](https://gemnasium.com/utgarda/sidekiq-status.svg)](https://gemnasium.com/utgarda/sidekiq-status)
6
- [![Inline docs](http://inch-ci.org/github/utgarda/sidekiq-status.svg?branch=master)](http://inch-ci.org/github/utgarda/sidekiq-status)
2
+ [![Gem Version](https://badge.fury.io/rb/sidekiq-status.svg)](https://badge.fury.io/rb/sidekiq-status)
3
+ [![Build Status](https://www.travis-ci.com/kenaniah/sidekiq-status.svg?branch=main)](https://www.travis-ci.com/github/kenaniah/sidekiq-status)
4
+ [![Inline docs](https://inch-ci.org/github/kenaniah/sidekiq-status.svg?branch=main)](https://inch-ci.org/github/kenaniah/sidekiq-status)
7
5
 
8
- An extension to [Sidekiq](http://github.com/mperham/sidekiq) message processing to track your jobs. Inspired
9
- by [resque-status](http://github.com/quirkey/resque-status) and mostly copying its features, using Sidekiq's middleware.
6
+ Sidekiq-status is an extension to [Sidekiq](https://github.com/mperham/sidekiq) that tracks information about your Sidekiq and provides a UI to that purpose. It was inspired by [resque-status](https://github.com/quirkey/resque-status).
10
7
 
11
- Fully compatible with ActiveJob.
12
-
13
- Supports the latest versions of Sidekiq and all the way back to 3.x.
8
+ Requires Ruby 2.6+ and Sidekiq 5.0+ or newer.
14
9
 
15
10
  ## Installation
16
11
 
@@ -20,18 +15,18 @@ Add this line to your application's Gemfile:
20
15
  gem 'sidekiq-status'
21
16
  ```
22
17
 
23
- And then execute:
24
-
25
- ```bash
26
- $ bundle
27
- ```
28
-
29
18
  Or install it yourself as:
30
19
 
31
20
  ```bash
32
21
  gem install sidekiq-status
33
22
  ```
34
23
 
24
+ #### Migrating to Version 2.x from 1.x
25
+
26
+ Version 2.0.0 was published in order to add support for Ruby 3.0 and Sidekiq 6.x and to remove support for versions of both that are now end-of-life. **You should be able to upgrade cleanly from version 1.x to 2.x provided you are running Sidekiq 5.x or newer.**
27
+
28
+ Sidekiq-status version 1.1.4 provides support all the way back to Sidekiq 3.x and was maintained at https://github.com/utgarda/sidekiq-status/.
29
+
35
30
  ## Setup Checklist
36
31
 
37
32
  To get started:
@@ -63,9 +58,7 @@ Sidekiq.configure_server do |config|
63
58
  end
64
59
  ```
65
60
 
66
- **Note:** This method of configuration is new as of version 0.8.0.
67
-
68
- After that you can use your jobs as usual. You need to also include the `Sidekiq::Status::Worker` module in your jobs if you want the additional functionality of tracking progress and storing / retrieving job data.
61
+ Include the `Sidekiq::Status::Worker` module in your jobs if you want the additional functionality of tracking progress and storing / retrieving job data.
69
62
 
70
63
  ``` ruby
71
64
  class MyJob
@@ -78,7 +71,7 @@ class MyJob
78
71
  end
79
72
  ```
80
73
 
81
- As of version 0.8.0, _only jobs that include `Sidekiq::Status::Worker`_ will have their statuses tracked. Previous versions of this gem used to track statuses for all jobs, even when `Sidekiq::Status::Worker` was not included.
74
+ Note: _only jobs that include `Sidekiq::Status::Worker`_ will have their statuses tracked.
82
75
 
83
76
  To overwrite expiration on a per-worker basis, write an expiration method like the one below:
84
77
 
@@ -105,7 +98,7 @@ As sidekiq-status stores information about jobs in Redis, it is necessary to set
105
98
 
106
99
  As explained above, the default expiration may also be overridden on a per-job basis by defining it within the job itself via a method called `#expiration`.
107
100
 
108
- The expiration time set will be used as the [Redis expire time](http://redis.io/commands/expire), which is also known as the TTL (time to live). Once the expiration time has passed, all information about the job's status and any custom data stored via sidekiq-status will disappear.
101
+ The expiration time set will be used as the [Redis expire time](https://redis.io/commands/expire), which is also known as the TTL (time to live). Once the expiration time has passed, all information about the job's status and any custom data stored via sidekiq-status will disappear.
109
102
 
110
103
  It is advised that you set the expiration time greater than the amount of time required to complete the job.
111
104
 
@@ -131,7 +124,7 @@ Important: If you try any of the above status method after the expiration time,
131
124
 
132
125
  ### ActiveJob Support
133
126
 
134
- Version 0.7.0 has added full support for ActiveJob. The status of ActiveJob jobs will be tracked automatically.
127
+ This gem also supports ActiveJob jobs. Their status will be tracked automatically.
135
128
 
136
129
  To also enable job progress tracking and data storage features, simply add the `Sidekiq::Status::Worker` module to your base class, like below:
137
130
 
@@ -216,11 +209,11 @@ This gem provides an extension to Sidekiq's web interface with an index at `/sta
216
209
 
217
210
  ![Sidekiq Status Web](web/sidekiq-status-web.png)
218
211
 
219
- As of 0.7.0, status information for an individual job may be found at `/statuses/:job_id`.
212
+ Information for an individual job may be found at `/statuses/:job_id`.
220
213
 
221
214
  ![Sidekiq Status Web](web/sidekiq-status-single-web.png)
222
215
 
223
- As of 0.8.0, only jobs that include `Sidekiq::Status::Worker` will be reported in the web interface.
216
+ Note: _only jobs that include `Sidekiq::Status::Worker`_ will be reported in the web interface.
224
217
 
225
218
  #### Adding the Web Interface
226
219
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "sidekiq", "~> 3"
5
+ gem "sidekiq", "~> 6"
6
6
 
7
7
  gemspec path: "../"
@@ -61,7 +61,7 @@ module Sidekiq::Status
61
61
  status = :retrying
62
62
  end
63
63
  end
64
- store_status worker.jid, status, expiry
64
+ store_status(worker.jid, status, expiry) if job_class && job_class.ancestors.include?(Sidekiq::Status::Worker)
65
65
  raise
66
66
  end
67
67
 
@@ -90,7 +90,7 @@ module Sidekiq::Status::Storage
90
90
  # - end: end score (i.e. +inf or a unix timestamp)
91
91
  # - offset: current progress through (all) jobs (e.g.: 100 if you want jobs from 100 to BATCH_LIMIT)
92
92
  def schedule_batch(options)
93
- options[:conn].zrangebyscore "schedule", options[:start], options[:end], {limit: [options[:offset], BATCH_LIMIT]}
93
+ options[:conn].zrangebyscore "schedule", options[:start], options[:end], limit: [options[:offset], BATCH_LIMIT]
94
94
  end
95
95
 
96
96
  # Searches the jobs Array for the job_id
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Status
3
- VERSION = '1.1.2'
3
+ VERSION = '2.0.2'
4
4
  end
5
5
  end
@@ -105,6 +105,10 @@ module Sidekiq::Status
105
105
  @statuses = @statuses.sort { |y,x| (x[sort_by] <=> y[sort_by]) || 1 }
106
106
  end
107
107
 
108
+ if params[:status] && params[:status] != "all"
109
+ @statuses = @statuses.select {|job_status| job_status["status"] == params[:status] }
110
+ end
111
+
108
112
  # Sidekiq pagination
109
113
  @total_size = @statuses.count
110
114
  @count = params[:per_page] ? params[:per_page].to_i : Sidekiq::Status::Web.default_per_page
@@ -132,7 +136,7 @@ module Sidekiq::Status
132
136
  job = Sidekiq::Status::get_all params['jid']
133
137
 
134
138
  if job.empty?
135
- halt [404, {"Content-Type" => "text/html"}, [erb(sidekiq_status_template(:status_not_found))]]
139
+ throw :halt, [404, {"Content-Type" => "text/html"}, [erb(sidekiq_status_template(:status_not_found))]]
136
140
  else
137
141
  @status = add_details_to_status(job)
138
142
  erb(sidekiq_status_template(:status))
@@ -144,21 +148,25 @@ module Sidekiq::Status
144
148
  job = Sidekiq::RetrySet.new.find_job(params[:jid])
145
149
  job ||= Sidekiq::DeadSet.new.find_job(params[:jid])
146
150
  job.retry if job
147
- halt [302, { "Location" => request.referer }, []]
151
+ throw :halt, [302, { "Location" => request.referer }, []]
148
152
  end
149
153
 
150
154
  # Removes a completed job from the status list
151
155
  app.delete '/statuses' do
152
156
  Sidekiq::Status.delete(params[:jid])
153
- halt [302, { "Location" => request.referer }, []]
157
+ throw :halt, [302, { "Location" => request.referer }, []]
154
158
  end
155
159
  end
156
160
  end
157
161
  end
158
162
 
159
- require 'sidekiq/web' unless defined?(Sidekiq::Web)
163
+ unless defined?(Sidekiq::Web)
164
+ require 'delegate' # Needed for sidekiq 5.x
165
+ require 'sidekiq/web'
166
+ end
167
+
160
168
  Sidekiq::Web.register(Sidekiq::Status::Web)
161
- ["per_page", "sort_by", "sort_dir"].each do |key|
169
+ ["per_page", "sort_by", "sort_dir", "status"].each do |key|
162
170
  Sidekiq::WebHelpers::SAFE_QPARAMS.push(key)
163
171
  end
164
172
  if Sidekiq::Web.tabs.is_a?(Array)
@@ -5,7 +5,7 @@ Gem::Specification.new do |gem|
5
5
  gem.authors = ['Evgeniy Tsvigun', 'Kenaniah Cerny']
6
6
  gem.email = ['utgarda@gmail.com', 'kenaniah@gmail.com']
7
7
  gem.summary = 'An extension to the sidekiq message processing to track your jobs'
8
- gem.homepage = 'http://github.com/utgarda/sidekiq-status'
8
+ gem.homepage = 'https://github.com/kenaniah/sidekiq-status'
9
9
  gem.license = 'MIT'
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
@@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
14
14
  gem.require_paths = ['lib']
15
15
  gem.version = Sidekiq::Status::VERSION
16
16
 
17
- gem.add_dependency 'sidekiq', '>= 3.0'
17
+ gem.add_dependency 'sidekiq', '>= 5.0'
18
18
  gem.add_dependency 'chronic_duration'
19
19
  gem.add_development_dependency 'appraisal'
20
20
  gem.add_development_dependency 'colorize'
@@ -36,21 +36,39 @@ describe Sidekiq::Status::ServerMiddleware do
36
36
  it "sets failed status when Exception raised" do
37
37
  allow(SecureRandom).to receive(:hex).once.and_return(job_id)
38
38
  start_server do
39
- expect(capture_status_updates(3) {
40
- expect(FailingHardJob.perform_async).to eq(job_id)
41
- }).to eq([job_id]*3)
39
+ expect(capture_status_updates(3) {
40
+ expect(FailingHardJob.perform_async).to eq(job_id)
41
+ }).to eq([job_id]*3)
42
42
  end
43
43
  expect(redis.hget("sidekiq:status:#{job_id}", :status)).to eq('failed')
44
44
  expect(Sidekiq::Status::failed?(job_id)).to be_truthy
45
45
  end
46
46
 
47
+ context "when Sidekiq::Status::Worker is not included in the job" do
48
+ it "should not set a failed status" do
49
+ allow(SecureRandom).to receive(:hex).once.and_return(job_id)
50
+ start_server do
51
+ expect(FailingNoStatusJob.perform_async).to eq(job_id)
52
+ end
53
+ expect(redis.hget("sidekiq:status:#{job_id}", :status)).to be_nil
54
+ end
55
+
56
+ it "should not set any status when Exception raised" do
57
+ allow(SecureRandom).to receive(:hex).once.and_return(job_id)
58
+ start_server do
59
+ expect(FailingHardNoStatusJob.perform_async).to eq(job_id)
60
+ end
61
+ expect(redis.hget("sidekiq:status:#{job_id}", :status)).to be_nil
62
+ end
63
+ end
64
+
47
65
  context "sets interrupted status" do
48
66
  it "on system exit signal" do
49
67
  allow(SecureRandom).to receive(:hex).once.and_return(job_id)
50
68
  start_server do
51
- expect(capture_status_updates(3) {
52
- expect(ExitedJob.perform_async).to eq(job_id)
53
- }).to eq([job_id]*3)
69
+ expect(capture_status_updates(3) {
70
+ expect(ExitedJob.perform_async).to eq(job_id)
71
+ }).to eq([job_id]*3)
54
72
  end
55
73
  expect(redis.hget("sidekiq:status:#{job_id}", :status)).to eq('interrupted')
56
74
  expect(Sidekiq::Status::interrupted?(job_id)).to be_truthy
@@ -13,6 +13,7 @@ describe 'sidekiq status web' do
13
13
  end
14
14
 
15
15
  before do
16
+ env 'rack.session', csrf: Base64.urlsafe_encode64('token')
16
17
  client_middleware
17
18
  allow(SecureRandom).to receive(:hex).and_return(job_id)
18
19
  end
@@ -31,6 +32,27 @@ describe 'sidekiq status web' do
31
32
  expect(last_response.body).to match(/working/)
32
33
  end
33
34
 
35
+ it 'allows filtering the list of jobs by status' do
36
+ capture_status_updates(2) do
37
+ LongJob.perform_async(0.5)
38
+ end
39
+
40
+ get '/statuses?status=working'
41
+ expect(last_response).to be_ok
42
+ expect(last_response.body).to match(/#{job_id}/)
43
+ expect(last_response.body).to match(/LongJob/)
44
+ expect(last_response.body).to match(/working/)
45
+ end
46
+
47
+ it 'allows filtering the list of jobs by completed status' do
48
+ capture_status_updates(2) do
49
+ LongJob.perform_async(0.5)
50
+ end
51
+ get '/statuses?status=completed'
52
+ expect(last_response).to be_ok
53
+ expect(last_response.body).to_not match(/LongJob/)
54
+ end
55
+
34
56
  it 'shows a single job in progress' do
35
57
  capture_status_updates(2) do
36
58
  LongJob.perform_async(1, 'another argument')
@@ -105,7 +105,7 @@ describe Sidekiq::Status do
105
105
  second_job = LongJob.perform_in(3600)
106
106
  expect(second_job).to eq(job_id_1)
107
107
 
108
- initial_schedule = redis.zrange "schedule", 0, -1, {withscores: true}
108
+ initial_schedule = redis.zrange "schedule", 0, -1, withscores: true
109
109
  expect(initial_schedule.size).to be(2)
110
110
  expect(initial_schedule.select {|scheduled_job| JSON.parse(scheduled_job[0])["jid"] == job_id }.size).to be(1)
111
111
 
@@ -113,7 +113,7 @@ describe Sidekiq::Status do
113
113
  # Unused, therefore unfound => false
114
114
  expect(Sidekiq::Status.cancel(unused_id)).to be_falsey
115
115
 
116
- remaining_schedule = redis.zrange "schedule", 0, -1, {withscores: true}
116
+ remaining_schedule = redis.zrange "schedule", 0, -1, withscores: true
117
117
  expect(remaining_schedule.size).to be(initial_schedule.size - 1)
118
118
  expect(remaining_schedule.select {|scheduled_job| JSON.parse(scheduled_job[0])["jid"] == job_id }.size).to be(0)
119
119
  end
@@ -126,14 +126,14 @@ describe Sidekiq::Status do
126
126
  returned_job_id = LongJob.perform_at(scheduled_time)
127
127
  expect(returned_job_id).to eq(job_id)
128
128
 
129
- initial_schedule = redis.zrange "schedule", 0, -1, {withscores: true}
129
+ initial_schedule = redis.zrange "schedule", 0, -1, withscores: true
130
130
  expect(initial_schedule.size).to be(1)
131
131
  # wrong time, therefore unfound => false
132
132
  expect(Sidekiq::Status.cancel(returned_job_id, (scheduled_time + 1))).to be_falsey
133
- expect((redis.zrange "schedule", 0, -1, {withscores: true}).size).to be(1)
133
+ expect((redis.zrange "schedule", 0, -1, withscores: true).size).to be(1)
134
134
  # same id, same time, deletes
135
135
  expect(Sidekiq::Status.cancel(returned_job_id, (scheduled_time))).to be_truthy
136
- expect(redis.zrange "schedule", 0, -1, {withscores: true}).to be_empty
136
+ expect(redis.zrange "schedule", 0, -1, withscores: true).to be_empty
137
137
  end
138
138
  end
139
139
  end
@@ -10,6 +10,16 @@ class StubJob
10
10
  end
11
11
  end
12
12
 
13
+ class StubNoStatusJob
14
+ include Sidekiq::Worker
15
+
16
+ sidekiq_options 'retry' => false
17
+
18
+ def perform(*args)
19
+ end
20
+ end
21
+
22
+
13
23
  class ExpiryJob < StubJob
14
24
  def expiration
15
25
  15
@@ -69,6 +79,12 @@ class FailingJob < StubJob
69
79
  end
70
80
  end
71
81
 
82
+ class FailingNoStatusJob < StubNoStatusJob
83
+ def perform
84
+ raise StandardError
85
+ end
86
+ end
87
+
72
88
  class RetryAndFailJob < StubJob
73
89
  sidekiq_options retry: 1
74
90
 
@@ -83,6 +99,12 @@ class FailingHardJob < StubJob
83
99
  end
84
100
  end
85
101
 
102
+ class FailingHardNoStatusJob < StubNoStatusJob
103
+ def perform
104
+ raise Exception
105
+ end
106
+ end
107
+
86
108
  class ExitedJob < StubJob
87
109
  def perform
88
110
  raise SystemExit
data/web/views/status.erb CHANGED
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
  </div>
30
30
 
31
- <div class="panel panel-default">
31
+ <div class="panel panel-default" style="background-color: inherit">
32
32
  <div class="panel-body">
33
33
  <h4><%= @status["worker"] %></h4>
34
34
 
@@ -1,5 +1,5 @@
1
1
  <h3>Job Status: <%= params[:jid] %></h3>
2
2
 
3
- <div class="alert alert-danger" role="alert">
3
+ <div role="alert">
4
4
  <strong>Uh oh!</strong> That job can't be found. It may have expired already.
5
5
  </div>
@@ -38,7 +38,7 @@
38
38
  display: flex;
39
39
  align-items: center;
40
40
  }
41
- .nav-container .per-page {
41
+ .nav-container .per-page, .filter-status {
42
42
  display: flex;
43
43
  align-items: center;
44
44
  margin: 20px 0 20px 10px;
@@ -57,6 +57,15 @@ function setPerPage(select){
57
57
  <h3 class="wi">Recent job statuses</h3>
58
58
  <div class="nav-container">
59
59
  <%= erb :_paging, locals: { url: "#{root_path}statuses" } %>
60
+ <div class="filter-status">
61
+ Filter Status:
62
+ <select class="form-control" onchange="setPerPage(this)">
63
+ <% (['all', 'complete', 'failed', 'interrupted', 'queued', 'retrying', 'stopped', 'working']).each do |status| %>
64
+ <option data-url="?<%= qparams(status: status)%>" value="<%= status %>" <%= 'selected="selected"' if status == (params[:status]) %>><%= status %></option>
65
+ <% end %>
66
+ </select>
67
+ </div>
68
+
60
69
  <div class="per-page">
61
70
  Per page:
62
71
  <select class="form-control" onchange="setPerPage(this)">
@@ -67,7 +76,7 @@ function setPerPage(select){
67
76
  </div>
68
77
  </div>
69
78
  </div>
70
- <table class="table table-hover table-bordered table-striped table-white">
79
+ <table class="table table-hover table-bordered table-striped">
71
80
  <tr>
72
81
  <% @headers.each do |h| %>
73
82
  <th class="header <%= h[:class] %> header_<%= h[:id] %>">
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-status
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Tsvigun
8
8
  - Kenaniah Cerny
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-03-20 00:00:00.000000000 Z
12
+ date: 2021-07-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '3.0'
20
+ version: '5.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: '3.0'
27
+ version: '5.0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: chronic_duration
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -123,7 +123,7 @@ dependencies:
123
123
  - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
- description:
126
+ description:
127
127
  email:
128
128
  - utgarda@gmail.com
129
129
  - kenaniah@gmail.com
@@ -141,9 +141,8 @@ files:
141
141
  - LICENSE
142
142
  - README.md
143
143
  - Rakefile
144
- - gemfiles/sidekiq_3.x.gemfile
145
- - gemfiles/sidekiq_4.x.gemfile
146
144
  - gemfiles/sidekiq_5.x.gemfile
145
+ - gemfiles/sidekiq_6.x.gemfile
147
146
  - lib/sidekiq-status.rb
148
147
  - lib/sidekiq-status/client_middleware.rb
149
148
  - lib/sidekiq-status/server_middleware.rb
@@ -168,11 +167,11 @@ files:
168
167
  - web/views/status.erb
169
168
  - web/views/status_not_found.erb
170
169
  - web/views/statuses.erb
171
- homepage: http://github.com/utgarda/sidekiq-status
170
+ homepage: https://github.com/kenaniah/sidekiq-status
172
171
  licenses:
173
172
  - MIT
174
173
  metadata: {}
175
- post_install_message:
174
+ post_install_message:
176
175
  rdoc_options: []
177
176
  require_paths:
178
177
  - lib
@@ -187,8 +186,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
186
  - !ruby/object:Gem::Version
188
187
  version: '0'
189
188
  requirements: []
190
- rubygems_version: 3.0.1
191
- signing_key:
189
+ rubygems_version: 3.2.15
190
+ signing_key:
192
191
  specification_version: 4
193
192
  summary: An extension to the sidekiq message processing to track your jobs
194
193
  test_files:
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "sidekiq", "~> 4"
6
-
7
- gemspec path: "../"