data_collector 0.39.0 → 0.41.0
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.
- checksums.yaml +4 -4
- data/lib/data_collector/ext/base.rb +13 -12
- data/lib/data_collector/input/rpc.rb +2 -2
- data/lib/data_collector/output/rpc.rb +4 -0
- data/lib/data_collector/output.rb +1 -1
- data/lib/data_collector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a1ff20af153214903e447f712e1103d1ad3f31c0d78116f0d53ada7e0ca4870
|
4
|
+
data.tar.gz: 8daf87004c13c9842f2c6c8bd32de92064e17305ec05cdcff6cc2d9aff3b83a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 614d463b0325b3d0a258e29eb1eb201e95123b77d0dfce47f798417f21a55a5c35b4d1109e6be563278dcedb0add4d275ee2408359a1727d5668d141497ba780
|
7
|
+
data.tar.gz: cc6429da9bb97ca08e01b9180d7eaedaa2800cf9b663c8486658a15371da45bb4f3650b833d885020af2034d59ccc249682d6590cbc4b333441af7e405092790
|
@@ -3,27 +3,27 @@ require 'connection_pool'
|
|
3
3
|
module BunnyBurrow
|
4
4
|
class Connection
|
5
5
|
include Singleton
|
6
|
-
attr_reader :connection
|
6
|
+
attr_reader :connection
|
7
7
|
attr_accessor :verify_peer, :connection_name, :rabbitmq_url
|
8
8
|
|
9
|
-
def initialize
|
10
|
-
super
|
11
|
-
@started = false
|
12
|
-
end
|
13
9
|
def connection
|
14
|
-
@connection
|
15
|
-
|
10
|
+
unless @connection
|
11
|
+
@connection = Bunny.new(@rabbitmq_url, verify_peer: @verify_peer, connection_name: @connection_name)
|
16
12
|
@connection.start
|
17
|
-
@started = true
|
18
13
|
end
|
19
14
|
|
15
|
+
@connection.start unless @connection.connected? || @connection.closed?
|
16
|
+
#@connection.start if @connection.closed?
|
17
|
+
|
18
|
+
#pp @connection.status
|
19
|
+
|
20
20
|
@connection
|
21
21
|
end
|
22
22
|
|
23
23
|
def channel
|
24
|
-
@channel
|
25
|
-
|
26
|
-
|
24
|
+
@channel = connection.create_channel unless @channel && @channel.open?
|
25
|
+
|
26
|
+
@channel
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -41,6 +41,7 @@ module BunnyBurrow
|
|
41
41
|
|
42
42
|
unless @connection
|
43
43
|
@connection = Connection.instance.connection
|
44
|
+
@connection.start unless @connection.open?
|
44
45
|
end
|
45
46
|
|
46
47
|
@connection
|
@@ -51,7 +52,7 @@ module BunnyBurrow
|
|
51
52
|
Connection.instance.verify_peer = @verify_peer
|
52
53
|
Connection.instance.rabbitmq_url = @rabbitmq_url
|
53
54
|
|
54
|
-
@channel
|
55
|
+
@channel = Connection.instance.channel
|
55
56
|
end
|
56
57
|
end
|
57
58
|
end
|
@@ -18,6 +18,8 @@ module DataCollector
|
|
18
18
|
@listener.shutdown
|
19
19
|
@running = false
|
20
20
|
end
|
21
|
+
rescue Bunny::ConnectionAlreadyClosed => e
|
22
|
+
DataCollector::Core.log(e.message)
|
21
23
|
rescue StandardError => e
|
22
24
|
DataCollector::Core.error(e.message)
|
23
25
|
end
|
@@ -28,8 +30,6 @@ module DataCollector
|
|
28
30
|
DataCollector::Core.error(e.message)
|
29
31
|
end
|
30
32
|
|
31
|
-
|
32
|
-
|
33
33
|
def run(should_block = false, &block)
|
34
34
|
@listener.subscribe(@bunny_queue) do |payload|
|
35
35
|
payload = JSON.parse(payload)
|
@@ -182,7 +182,7 @@ module DataCollector
|
|
182
182
|
raise "unable to save to file: #{e.message}"
|
183
183
|
end
|
184
184
|
|
185
|
-
def to_jsonfile
|
185
|
+
def to_jsonfile(jsondata, jsonfile)
|
186
186
|
raise '[DEPRECATED] `to_jsonfile` deprecated. Please use `to_uri("file://abc.json", {template: "template.erb", content_type: "application/json"})` instead'
|
187
187
|
rescue Exception => e
|
188
188
|
raise "unable to save to jsonfile: #{e.message}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.41.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mehmet Celik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|