sidekiq_monitor 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,12 @@
1
1
  div.dataTables_length label
2
2
  float: right
3
3
 
4
+ .jobs-table td
5
+ max-width: 200px
6
+ overflow: auto
7
+ text-overflow: ellipsis
8
+ white-space: nowrap
9
+
4
10
  .jobs-table-wrapper
5
11
  clear: both
6
12
 
@@ -6,7 +6,7 @@ module Sidekiq
6
6
  serialize :args
7
7
  serialize :result
8
8
 
9
- after_destroy :destroy_in_queue
9
+ after_destroy :delete_sidekiq_job
10
10
 
11
11
  STATUSES = [
12
12
  'queued',
@@ -15,12 +15,23 @@ module Sidekiq
15
15
  'failed'
16
16
  ]
17
17
 
18
- def destroy_in_queue
19
- return true unless status == 'queued'
18
+ def sidekiq_item
19
+ job = sidekiq_job
20
+ job ? job.item : nil
21
+ end
22
+
23
+ def sidekiq_job
20
24
  sidekiq_queue = Sidekiq::Queue.new(queue)
21
25
  sidekiq_queue.each do |job|
22
- return job.delete if job.jid == jid
26
+ return job if job.jid == jid
23
27
  end
28
+ nil
29
+ end
30
+
31
+ def delete_sidekiq_job
32
+ return true unless status == 'queued'
33
+ job = sidekiq_job
34
+ job.delete if job
24
35
  end
25
36
 
26
37
  def self.destroy_by_queue(queue, conditions={})
data/config/routes.rb CHANGED
@@ -1,10 +1,12 @@
1
1
  Sidekiq::Monitor::Engine.routes.draw do
2
- match '/' => 'jobs#index', :as => 'sidekiq_monitor'
3
- match '/queues' => 'queues#index'
2
+ get '/', to: 'jobs#index', :as => 'sidekiq_monitor'
3
+ get '/queues', to: 'queues#index'
4
4
 
5
5
  namespace 'api' do
6
- match '/jobs' => 'jobs#index'
7
- match '/jobs/:action(/:id)' => 'jobs'
8
- match '/queues/:queue' => 'queues#show'
6
+ get '/jobs', to: 'jobs#index'
7
+ get '/jobs/clean', to: 'jobs#clean'
8
+ get '/jobs/custom_views/:id', to: 'jobs#custom_views'
9
+ get '/jobs/retry/:id', to: 'jobs#retry'
10
+ get '/queues/:queue', to: 'queues#show'
9
11
  end
10
12
  end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Monitor
3
- VERSION = '0.0.4'
3
+ VERSION = '0.0.5'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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: 2013-07-11 00:00:00.000000000 Z
12
+ date: 2013-07-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq
@@ -126,7 +126,8 @@ files:
126
126
  - Rakefile
127
127
  - README.md
128
128
  homepage: https://github.com/socialpandas/sidekiq_monitor
129
- licenses: []
129
+ licenses:
130
+ - MIT
130
131
  post_install_message:
131
132
  rdoc_options: []
132
133
  require_paths: