sidekiq_monitor 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
- <% url_helpers = Sidekiq::Monitor::Engine.routes.url_helpers %>
2
1
  window.SidekiqMonitor =
3
2
  settings:
4
3
  api_url: (path) ->
5
- "<%= url_helpers.sidekiq_monitor_path %>api/#{path}"
4
+ "<%= Sidekiq::Monitor.root_path %>api/#{path}"
6
5
  graphs: <%= Sidekiq::Monitor.options[:graphs].to_json %>
7
6
  poll_interval: <%= Sidekiq::Monitor.options[:poll_interval] %>
@@ -6,7 +6,7 @@ module Sidekiq
6
6
  end
7
7
 
8
8
  def root_path
9
- Sidekiq::Monitor::Engine.routes.url_helpers.sidekiq_monitor_path
9
+ Sidekiq::Monitor.root_path
10
10
  end
11
11
  end
12
12
  end
@@ -26,6 +26,11 @@ module Sidekiq
26
26
  def self.table_name_prefix
27
27
  'sidekiq_'
28
28
  end
29
+
30
+ def self.root_path
31
+ sidekiq_monitor_path = Sidekiq::Monitor::Engine.routes.url_helpers.sidekiq_monitor_path
32
+ "#{::Rails.application.config.relative_url_root}#{sidekiq_monitor_path}"
33
+ end
29
34
  end
30
35
  end
31
36
 
@@ -7,8 +7,10 @@ module Sidekiq
7
7
  end
8
8
 
9
9
  def call(worker_class, item, queue)
10
- @processor.queue(worker_class, item, queue)
11
- yield
10
+ ActiveRecord::Base.connection_pool.with_connection do
11
+ @processor.queue(worker_class, item, queue)
12
+ yield
13
+ end
12
14
  end
13
15
  end
14
16
  end
@@ -7,15 +7,17 @@ module Sidekiq
7
7
  end
8
8
 
9
9
  def call(worker, msg, queue)
10
- @processor.start(worker, msg, queue)
11
- begin
12
- return_value = yield
13
- rescue Exception => exception
14
- @processor.error(worker, msg, queue, exception)
15
- raise exception
10
+ ActiveRecord::Base.connection_pool.with_connection do
11
+ @processor.start(worker, msg, queue)
12
+ begin
13
+ return_value = yield
14
+ rescue Exception => exception
15
+ @processor.error(worker, msg, queue, exception)
16
+ raise exception
17
+ end
18
+ @processor.complete(worker, msg, queue, return_value)
19
+ return_value
16
20
  end
17
- @processor.complete(worker, msg, queue, return_value)
18
- return_value
19
21
  end
20
22
  end
21
23
  end
@@ -1,5 +1,5 @@
1
1
  module Sidekiq
2
2
  module Monitor
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
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.1.1
4
+ version: 0.1.2
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: 2014-03-25 00:00:00.000000000 Z
12
+ date: 2014-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sidekiq