sidekiq_monitor 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -171,7 +171,8 @@ class SidekiqMonitor.AbstractJobsTable
171
171
  $('.job-custom-views', modal).html(html)
172
172
 
173
173
  on_poll: =>
174
- @reload_table()
174
+ if document.hasFocus()
175
+ @reload_table()
175
176
 
176
177
  reload_table: =>
177
178
  @table.dataTable().fnStandingRedraw()
@@ -12,6 +12,8 @@ class SidekiqMonitor.Graph
12
12
  @height = 580
13
13
  @padding = [120, 50, 30, 20]
14
14
 
15
+ return null unless $(options.selector).length
16
+
15
17
  # These correspond to Job.statuses: queued, running, complete, failed, [custom statuses]
16
18
  colors = ['lightblue', 'blue', 'green', 'red', 'gray', 'purple', 'yellow']
17
19
 
@@ -26,7 +28,8 @@ class SidekiqMonitor.Graph
26
28
 
27
29
  start_polling: =>
28
30
  setInterval =>
29
- @render()
31
+ if document.hasFocus()
32
+ @render()
30
33
  , @options.poll_interval
31
34
 
32
35
  render: =>
@@ -87,8 +87,5 @@ class SidekiqMonitor.QueueJobsTable extends SidekiqMonitor.AbstractJobsTable
87
87
  @api_params['queue'] = @queue
88
88
  @show_queue_stats()
89
89
 
90
- on_poll: =>
91
- @reload_table()
92
-
93
90
  $ ->
94
91
  new SidekiqMonitor.QueueJobsTable
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Monitor
3
- VERSION = '0.0.7'
3
+ VERSION = '0.0.8'
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.7
4
+ version: 0.0.8
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-08-02 00:00:00.000000000 Z
12
+ date: 2013-08-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq