sidekiq_monitor 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/sidekiq/monitor/initialize.js.coffee.erb +1 -2
- data/app/helpers/sidekiq/monitor/sidekiq_helper.rb +1 -1
- data/lib/sidekiq/monitor.rb +5 -0
- data/lib/sidekiq/monitor/client/middleware.rb +4 -2
- data/lib/sidekiq/monitor/server/middleware.rb +10 -8
- data/lib/sidekiq/monitor/version.rb +1 -1
- metadata +2 -2
@@ -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
|
-
"<%=
|
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] %>
|
data/lib/sidekiq/monitor.rb
CHANGED
@@ -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
|
-
|
11
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
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.
|
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-
|
12
|
+
date: 2014-04-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|