data_collector 0.31.0 → 0.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec0485c6ec0c9c429f8dcef45b7357874f3f6de8449902f54f38a1fb36e2548a
4
- data.tar.gz: 57820299fe1718fa07e561dc933c14d04aa2fbfe5ad264dfafa2db861c162aed
3
+ metadata.gz: a236c17cf807b2c641b9da834633dc9ed7a0d297b5638367726554c7f09f37b2
4
+ data.tar.gz: 95282bdbc813b58e9f15b4b4e24bb2f56ff9933ea8c209c60bbb9c368c0fd7a6
5
5
  SHA512:
6
- metadata.gz: aea723ca8aee53554b06259ad463b7bc460b0363bfce702dd3d7292519c185660fd86270a3d9b6c84db49133ed74d57eebcf27fcf974184465506967b96de56b
7
- data.tar.gz: ffc8d3e780aab83742fc8fefdabf3f10fbdcbed5fdcddce1a69c81754e84f951e7b7ccd896037f91f82f7da23d8fd650c67d6982281ab80f23e5bb54ec0c9537
6
+ metadata.gz: 4cd169de59382390b9fba943bfa726d7f4c276ce4b7a18a8ab6cbbf115a040acf6c90ecc55b8367f4888962fe9829b2b952976e3911fcedfb253415939a16aac
7
+ data.tar.gz: d5b0c8f43c20b3870445dea95fc72819e5fc016aabf39e37c99b74207bdf289d84b2096a37e7e88599664015153d82dd3fbd38d524e92e5c3df5877b5fcb2538
@@ -14,6 +14,8 @@ module DataCollector
14
14
 
15
15
  def running?
16
16
  @running
17
+ rescue StandardError => e
18
+ DataCollector::Core.error(e.message)
17
19
  end
18
20
 
19
21
  def stop
@@ -21,10 +23,14 @@ module DataCollector
21
23
  @listener.shutdown
22
24
  @running = false
23
25
  end
26
+ rescue StandardError => e
27
+ DataCollector::Core.error(e.message)
24
28
  end
25
29
 
26
30
  def pause
27
31
  raise "PAUSE not implemented."
32
+ rescue StandardError => e
33
+ DataCollector::Core.error(e.message)
28
34
  end
29
35
 
30
36
 
@@ -47,16 +53,23 @@ module DataCollector
47
53
  else
48
54
  yield block if block_given?
49
55
  end
56
+ rescue StandardError => e
57
+ DataCollector::Core.error(e.message)
50
58
  end
51
59
 
52
60
  private
53
- def create_listener
61
+ def create_listener(log = false)
54
62
  @listener ||= BunnyBurrow::Server.new do |server|
55
63
  parse_uri
56
64
  server.rabbitmq_url = @bunny_uri.to_s
57
65
  server.rabbitmq_exchange = @bunny_channel
58
- #server.logger = DataCollector::Core.logger
66
+
67
+ server.logger = DataCollector::Core.logger if log
59
68
  end
69
+
70
+ @listener
71
+ rescue StandardError => e
72
+ DataCollector::Core.error(e.message)
60
73
  end
61
74
 
62
75
  def parse_uri
@@ -43,10 +43,11 @@ module DataCollector
43
43
  @data[k] << v
44
44
  end
45
45
  else
46
- @data[k] = v
47
- # HELP: why am I creating an array here?
48
- # t = data[k]
49
- # data[k] = Array.new([t, v])
46
+ if v.is_a?(Array) # merge with array
47
+ @data[k] = [@data[k]] + v
48
+ else
49
+ @data[k] = v
50
+ end
50
51
  end
51
52
  else
52
53
  @data[k] = v
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module DataCollector
3
- VERSION = "0.31.0"
3
+ VERSION = "0.32.0"
4
4
  end
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.31.0
4
+ version: 0.32.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-09-18 00:00:00.000000000 Z
11
+ date: 2023-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport