sidekiq-failures 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 0.0.3
4
+
5
+ * Adequate layout to new sidekiq web ui design (@krasnoukhov)
6
+ * Improve backtrace view (@krasnoukhov)
7
+ * Remove unnecessary slash in redirect (@krasnoukhov)
8
+ * Invert order of failed jobs (@krasnoukhov)
9
+
3
10
  ## 0.0.2
4
11
 
5
12
  * Show backtrace similar to resque (Kunal Modi)
@@ -10,7 +10,13 @@ module Sidekiq
10
10
  end
11
11
 
12
12
  Sidekiq::Web.register Sidekiq::Failures::WebExtension
13
- Sidekiq::Web.tabs << "Failures"
13
+
14
+ if Sidekiq::Web.tabs.is_a?(Array)
15
+ # For sidekiq < 2.5
16
+ Sidekiq::Web.tabs << "failures"
17
+ else
18
+ Sidekiq::Web.tabs["Failures"] = "failures"
19
+ end
14
20
 
15
21
  Sidekiq.server_middleware do |chain|
16
22
  chain.add Sidekiq::Failures::Middleware
@@ -14,7 +14,7 @@ module Sidekiq
14
14
  :queue => queue
15
15
  }
16
16
 
17
- Sidekiq.redis { |conn| conn.rpush(:failed, Sidekiq.dump_json(data)) }
17
+ Sidekiq.redis { |conn| conn.lpush(:failed, Sidekiq.dump_json(data)) }
18
18
 
19
19
  raise
20
20
  end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Failures
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1,30 +1,36 @@
1
- h1 Failed Jobs
1
+ header.row
2
+ .span5
3
+ h3 Failed Jobs
4
+ .span4
5
+ - if @messages.size > 0
6
+ == slim :_paging, :locals => { :url => "#{root_path}failures/#@name" }
2
7
 
3
8
  - if @messages.size > 0
4
- == slim :_paging, :locals => { :url => "#{root_path}failures/#@name" }
5
-
6
- table class="table table-striped table-bordered"
7
- tr
8
- th Worker
9
- th Args
10
- th Queue
11
- th Failed At
12
- th Exception
9
+ table class="table table-striped table-bordered table-white" style="width: 100%; margin: 0; table-layout:fixed;"
10
+ thead
11
+ th style="width: 25%" Worker, Args
12
+ th style="width: 10%" Queue
13
+ th style="width: 15%" Failed At
14
+ th style="width: 50%" Exception
13
15
  - @messages.each do |msg|
14
16
  tr
15
- td= msg['worker']
16
- td= msg['payload']['args'].inspect[0..100]
17
+ td style="overflow: hidden; text-overflow: ellipsis;"
18
+ = msg['worker']
19
+ br
20
+ = msg['payload']['args'].inspect[0..100]
17
21
  td= msg['queue']
18
- td= msg['failed_at']
19
22
  td
20
- = "#{msg['exception']}: "
21
- a.backtrace href="#" onclick="$(this).next().toggle()" =msg['error']
22
- pre style="display:none; font-size: 0.8em" = msg['backtrace'].join("\n")
23
-
24
- form.form-horizontal action="#{root_path}failures/remove" method="post"
25
- input.btn.btn-danger type="submit" name="delete" value="Clear All"
23
+ time datetime="#{Time.parse(msg['failed_at']).getutc.iso8601}"
24
+ = msg['failed_at']
25
+ td style="overflow: auto; padding: 10px;"
26
+ a.backtrace href="#" onclick="$(this).next().toggle(); return false" = "#{msg['exception']}: #{msg['error']}"
27
+ pre style="display: none; background: none; border: 0; width: 100%; max-height: 30em; font-size: 0.8em; white-space: nowrap;" == msg['backtrace'].join("<br />")
26
28
 
27
- == slim :_paging, :locals => { :url => "#{root_path}failures/#@name" }
29
+ div.row
30
+ .span5
31
+ form.form-horizontal action="#{root_path}failures/remove" method="post" style="margin: 20px 0"
32
+ input.btn.btn-danger.btn-small type="submit" name="delete" value="Clear All"
33
+ .span4
34
+ == slim :_paging, :locals => { :url => "#{root_path}failures/#@name" }
28
35
  - else
29
- p No failed jobs found.
30
- a href="#{root_path}" Back
36
+ .alert.alert-success No failed jobs found.
@@ -22,7 +22,7 @@ module Sidekiq
22
22
  app.post "/failures/remove" do
23
23
  Sidekiq.redis {|c| c.del(:failed) }
24
24
 
25
- redirect "#{root_path}/failures"
25
+ redirect "#{root_path}failures"
26
26
  end
27
27
  end
28
28
  end
data/test/test_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ Encoding.default_external = Encoding::UTF_8
2
+ Encoding.default_internal = Encoding::UTF_8
3
+
1
4
  require "minitest/autorun"
2
5
  require "minitest/spec"
3
6
  require "minitest/mock"
@@ -17,7 +17,7 @@ module Sidekiq
17
17
  get '/'
18
18
 
19
19
  last_response.status.must_equal 200
20
- last_response.body.must_match /Sidekiq is idle/
20
+ last_response.body.must_match /Sidekiq/
21
21
  last_response.body.must_match /Failures/
22
22
  end
23
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-failures
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-30 00:00:00.000000000 Z
12
+ date: 2012-11-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -144,7 +144,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
144
144
  version: '0'
145
145
  segments:
146
146
  - 0
147
- hash: -1783905454239624780
147
+ hash: -2051440200690725249
148
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
153
  version: '0'
154
154
  segments:
155
155
  - 0
156
- hash: -1783905454239624780
156
+ hash: -2051440200690725249
157
157
  requirements: []
158
158
  rubyforge_project:
159
159
  rubygems_version: 1.8.23