atomic-sidekiq 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +3 -0
- data/atomic-sidekiq.gemspec +2 -2
- data/lib/atomic_sidekiq.rb +1 -0
- data/lib/atomic_sidekiq/web.rb +25 -20
- data/web/views/in_flight.erb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f7105489c8bcd6f544b6483f1a70f9d2e597efe83ac0ba8698a7e38de9e574c5
|
4
|
+
data.tar.gz: 41e6812af85bca568187cc011cc43fe535245ae7371cbaf077c9393606463f08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee3ffc740ef11258bd1024be322c977fc223d7ba5958808ca10dc5307583170da5dac3e356da6423033579b97c12c272e1d1c699eeaa526e9f810b9818c11b4c
|
7
|
+
data.tar.gz: 8e65b95d1a9b04bb237c4bba8269bcf7d5ec3a2aa4d01dfee10ec7aec6095f1a71c4f97e1ed81f9fa29b0661e0dca1e21aa7b10b890087273f8a543d804f90b4
|
data/.rubocop.yml
CHANGED
data/atomic-sidekiq.gemspec
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "atomic-sidekiq"
|
5
|
-
s.version = "1.1.
|
6
|
-
s.date = "2018-
|
5
|
+
s.version = "1.1.3"
|
6
|
+
s.date = "2018-12-17"
|
7
7
|
s.summary = "Reliable fetcher for Sidekiq"
|
8
8
|
s.description = "Reliable fetcher for Sidekiq"
|
9
9
|
s.homepage = "https://github.com/Colex/atomic-sidekiq"
|
data/lib/atomic_sidekiq.rb
CHANGED
data/lib/atomic_sidekiq/web.rb
CHANGED
@@ -3,33 +3,38 @@ module AtomicSidekiq
|
|
3
3
|
VIEW_PATH = File.expand_path("../../web/views", __dir__)
|
4
4
|
|
5
5
|
def self.registered(app)
|
6
|
+
register_inflight(app)
|
7
|
+
register_recovered(app)
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.register_inflight(app)
|
6
11
|
app.get "/in-flight" do
|
7
|
-
|
8
|
-
|
12
|
+
@jobs = AtomicSidekiq::InFlightQueue.new.list
|
13
|
+
@total_size = @jobs.count
|
14
|
+
@count = (params[:count] || 25).to_i
|
15
|
+
@current_page = (params[:page] || 1).to_i
|
9
16
|
|
10
|
-
|
11
|
-
|
17
|
+
start_idx = (@current_page - 1) * @count
|
18
|
+
end_idx = (@current_page * @count) - 1
|
19
|
+
@jobs = @jobs[start_idx..end_idx]
|
20
|
+
|
21
|
+
erb File.read(File.join(VIEW_PATH, "in_flight.erb"))
|
12
22
|
end
|
13
23
|
end
|
14
24
|
|
15
|
-
def self.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
@current_page = (params[:page] || 1).to_i
|
20
|
-
@jobs = @jobs[@current_page..(@current_page + @count)]
|
21
|
-
erb File.read(File.join(VIEW_PATH, "in_flight.erb"))
|
22
|
-
end
|
25
|
+
def self.register_recovered(app)
|
26
|
+
app.get "/recovered" do
|
27
|
+
@queues = AtomicSidekiq::RecoveredStats.new.stats_by_queue
|
28
|
+
@jobs = AtomicSidekiq::RecoveredStats.new.stats_by_job
|
23
29
|
|
24
|
-
|
25
|
-
|
26
|
-
@jobs = AtomicSidekiq::RecoveredStats.new.stats_by_job
|
27
|
-
erb File.read(File.join(VIEW_PATH, "recovered.erb"))
|
30
|
+
erb File.read(File.join(VIEW_PATH, "recovered.erb"))
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
30
34
|
end
|
31
35
|
|
32
|
-
|
33
|
-
Sidekiq::Web.register(AtomicSidekiq::Web)
|
34
|
-
Sidekiq::Web.tabs["In-flight"] = "in-flight"
|
35
|
-
Sidekiq::Web.tabs["Recovered"] = "recovered"
|
36
|
+
if defined?(Sidekiq::Web)
|
37
|
+
Sidekiq::Web.register(AtomicSidekiq::Web)
|
38
|
+
Sidekiq::Web.tabs["In-flight"] = "in-flight"
|
39
|
+
Sidekiq::Web.tabs["Recovered"] = "recovered"
|
40
|
+
end
|
data/web/views/in_flight.erb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atomic-sidekiq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Correia Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
191
191
|
version: '0'
|
192
192
|
requirements: []
|
193
193
|
rubyforge_project:
|
194
|
-
rubygems_version: 2.
|
194
|
+
rubygems_version: 2.7.6
|
195
195
|
signing_key:
|
196
196
|
specification_version: 4
|
197
197
|
summary: Reliable fetcher for Sidekiq
|