gaddygaddy 0.1.85 → 0.1.86

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: be7f969305f81f31641018f7bfb65b0da814afb9
4
- data.tar.gz: be43280d300a448f67e887ba659cf99cce1e2067
3
+ metadata.gz: e0d5dfb54a957d0045f0db7052db4d8da9b42964
4
+ data.tar.gz: eeff741eff969c4cbfde4835e6273389f648c6c3
5
5
  SHA512:
6
- metadata.gz: 167c541b19e551066d27d450ac6ecc8c96c6b955aa5a375247c75e00f1a67d3d8827d362400de9a2b6c19810d3fcebf3275991c606ccb90fd8468b85e3f1555d
7
- data.tar.gz: 2f7c47c88d01d6e5289fbd7bcf810ef26c1a18ec182badf2f415b773c86768f4c944ccd42aad3782c9622ec9360528494c6b1690a3d391de9d42d4a7f75f21e2
6
+ metadata.gz: 2f05de2247d0dac16c8b242bec7217a6455e9aac84f517ca29c7fd4602b088d602c37ebabab5dbf7aee41687d3408038014ac91f010afa9394c8d5b2d239a787
7
+ data.tar.gz: 082013f33a9a40ed8d700fc930638234417182448f86b53189e16f01c3296bfd185e015abaa9fe101417b59a62ad8c683bb0a5b5c8b271dfc448a92fe8d349b8
@@ -22,19 +22,15 @@ module Notification
22
22
  # To change this template use File | Settings | File Templates.
23
23
  def self.notify(event, message_text)
24
24
  report = {
25
- :name => "gaddy_notification",
26
- :output => event.to_json,
27
- :status => 2,
28
- :handler => 'send_event'
25
+ :name => "gaddy_notification",
26
+ :output => event.to_json,
27
+ :status => 2,
28
+ :handler => 'send_event'
29
29
  }
30
30
 
31
- begin
32
- s = TCPSocket.open(SENSU_HOST, SENSU_PORT)
33
- s.print JSON.generate(report)
34
- s.close
35
- rescue Exception => e
36
- puts e.message
37
- end
31
+ s = TCPSocket.open(SENSU_HOST, SENSU_PORT)
32
+ s.print JSON.generate(report)
33
+ s.close
38
34
  end
39
35
  end
40
36
  end
@@ -14,6 +14,7 @@
14
14
  #
15
15
 
16
16
  require_relative '../logging/logging'
17
+ require_relative '../utils/retriable'
17
18
  require_relative 'notification/file_notification'
18
19
  require_relative 'notification/espeak'
19
20
  require_relative 'notification/sensu'
@@ -23,6 +24,7 @@ require 'i18n'
23
24
  module Notification
24
25
  class Send
25
26
  include Logging
27
+ include Retriable
26
28
 
27
29
  def initialize(options = {})
28
30
  I18n.load_path += Dir[File.join(File.dirname(__FILE__), '..','..','locales', '*.yml').to_s]
@@ -66,7 +68,7 @@ module Notification
66
68
  should_speak = ! Notification::FileNotification.text_in_log_file(message_as_text)
67
69
  Notification::Wall.notify(event, message_as_text)
68
70
  Notification::FileNotification.notify(event, message_as_text)
69
- Notification::Sensu.notify(event, message_as_text)
71
+ with_retries(:limit => 3, :sleep=> 10) {Notification::Sensu.notify(event, message_as_text)}
70
72
  Notification::ESpeakNotification.notify(event, message_as_text) if should_speak && @speech_enabled
71
73
  end
72
74
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaddygaddy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.85
4
+ version: 0.1.86
5
5
  platform: ruby
6
6
  authors:
7
7
  - GaddyGaddy