bipbip 0.7.5 → 0.7.6

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
  SHA1:
3
- metadata.gz: d9f5ff37e7dbd08fd60d9047afa4fc32917d5229
4
- data.tar.gz: 0c82af0a79c0aac3c2b0897d69a4b8b4f642b509
3
+ metadata.gz: 16fdb7060fac95aa36861da6c0ef00e2cf93ea8a
4
+ data.tar.gz: b83c498c93518cf3e00c213f83adc802c32cf065
5
5
  SHA512:
6
- metadata.gz: 1268f218892331d51dec2c5f7833ecfb49d0b903c94bfd7a28a874b4ef6ad9d6153bd44805d37a1f42f4c8ebec5eb7e6d85fec28055a4e433aa4aab330e5dcff
7
- data.tar.gz: 19873db10eb419fc17cebb673a08d8845b567673da7291870930911838b653ad7ceece343be4d087f5a267e8504193f453d632a0f9c38c861c5888b61b0b5ad9
6
+ metadata.gz: b8c7e298b384f8073141186e410e998e4729ab8f06c0e7b97b8970b854fdf41ba169033c57ea5ca9e15941e2bbe49d43a7c73bbc9143a91cd0646101807074e6
7
+ data.tar.gz: ddc205d79f1aa89fc6009fb3131687a41a6e11dde8476b6273bd81fb8fb1951c43059cc75864a7cea7dcdb1290274d4b7e01aa0e3a0c238bc669b28edb04a90e
data/lib/bipbip/agent.rb CHANGED
@@ -26,7 +26,13 @@ module Bipbip
26
26
  @storages.each do |storage|
27
27
  @plugins.each do |plugin|
28
28
  Bipbip.logger.info "Setting up plugin #{plugin.name} for storage #{storage.name}"
29
- storage.setup_plugin(plugin)
29
+ begin
30
+ storage.setup_plugin(plugin)
31
+ rescue => e
32
+ Bipbip.logger.fatal "Failed to setup plugin #{plugin.name} for storage #{storage.name}: `#{e.message}`. Retrying..."
33
+ sleep 5
34
+ retry
35
+ end
30
36
  end
31
37
  end
32
38
 
@@ -11,8 +11,7 @@ module Bipbip
11
11
  @tags ||= _load_tags
12
12
 
13
13
  unless [5, 15, 60, 300, 900, 3600, 21_600].include?(plugin.frequency)
14
- log(Logger::FATAL, "Cannot use frequency #{plugin.frequency}")
15
- exit 1
14
+ raise "Cannot use frequency #{plugin.frequency}"
16
15
  end
17
16
 
18
17
  metric_group = @metric_groups.detect { |m| m.name == plugin.metric_group }
@@ -65,20 +64,14 @@ module Bipbip
65
64
  def _load_metric_groups
66
65
  log(Logger::INFO, 'Loading metric groups')
67
66
  metric_groups = ::Copperegg::Revealmetrics::MetricGroup.find
68
- if metric_groups.nil?
69
- log(Logger::FATAL, 'Cannot load metric groups')
70
- exit 1
71
- end
67
+ raise 'Cannot load metric groups' if metric_groups.nil?
72
68
  metric_groups
73
69
  end
74
70
 
75
71
  def _load_dashboards
76
72
  log(Logger::INFO, 'Loading dashboards')
77
73
  dashboards = ::Copperegg::Revealmetrics::CustomDashboard.find
78
- if dashboards.nil?
79
- log(Logger::FATAL, 'Cannot load dashboards')
80
- exit 1
81
- end
74
+ raise 'Cannot load dashboards' if dashboards.nil?
82
75
  dashboards
83
76
  end
84
77
 
@@ -86,10 +79,7 @@ module Bipbip
86
79
  def _load_tags
87
80
  log(Logger::INFO, 'Loading tags')
88
81
  tags = ::Copperegg::Revealmetrics::Tag.find
89
- if tags.nil?
90
- log(Logger::FATAL, 'Cannot load tags')
91
- exit 1
92
- end
82
+ raise 'Cannot load tags' if tags.nil?
93
83
  tags
94
84
  end
95
85
  end
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.7.5'.freeze
2
+ VERSION = '0.7.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bipbip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-10-06 00:00:00.000000000 Z
13
+ date: 2016-10-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: copperegg-revealmetrics