fluent-plugin-festival 0.0.5 → 0.0.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: b45d490133de5d8ac156916e2c6a7c0942af062e
4
- data.tar.gz: 997f3fae94b7d9f02b97a340a88c847428012c1e
3
+ metadata.gz: 328283ff85d814d57b5e9c06aac86f4d5c3faf7c
4
+ data.tar.gz: 20c812a04801f2ebe7940992151824119374b81b
5
5
  SHA512:
6
- metadata.gz: 153b78c3058879c365c403d3dc21ff4b5e929a3c32618fb6e78978bb812e6965cc4f041af539896a0f9ac18cd9527d276618bb0a5a4a91e9e6557b17a96c04e8
7
- data.tar.gz: 600b3fafe658a662731fdf10f33bbd58d03293592204c98eb950ddc6ac31130e1d8628cab93894cafb0bd5f5b83fff89026061282d86cca9dc1e449064c3e72a
6
+ metadata.gz: bce12f937c6e8f2bd01d4dfdbfa5b3a005d4a97c2a03bc8a77237eff0745e4462991990946a0302ecdb608ab03a55f523d059350e79ed35c7da9bb06b608ca84
7
+ data.tar.gz: 225ea212bee5b941eb75cd12c86fd5d7f2133af54be5247c3db8320eb555c29a967a283b2ea3af4e7cc40dc6008bef557507d7b0b22deb4ac5b9ac3f46ea5848
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-festival"
7
- spec.version = "0.0.5"
7
+ spec.version = "0.0.6"
8
8
  spec.authors = ["Toyokazu Akiyama"]
9
9
  spec.email = ["toyokazu@gmail.com"]
10
10
 
@@ -26,7 +26,7 @@ module Fluent::Plugin
26
26
 
27
27
  def error_handler(response, message)
28
28
  if response.code != "200"
29
- log.error :error => message
29
+ log.error error: message
30
30
  log.debug "code: #{response.code}"
31
31
  log.debug "message: #{response.message}"
32
32
  log.debug "body: #{response.body}"
@@ -9,10 +9,10 @@ module Fluent::Plugin
9
9
 
10
10
  Fluent::Plugin.register_input('festival', self)
11
11
 
12
- helpers :thread, :compat_parameters
12
+ helpers :timer
13
13
 
14
14
  desc 'FESTIVAL EaaS API URI'
15
- config_param :api_uri, :string, :default => 'https://api.festival-project.eu'
15
+ config_param :api_uri, :string, default: 'https://api.festival-project.eu'
16
16
  desc 'email (login_name) for FESTIVAL EaaS API'
17
17
  config_param :email, :string
18
18
  desc 'password for FESTIVAL EaaS API'
@@ -25,7 +25,7 @@ module Fluent::Plugin
25
25
  desc 'The tag of the event.'
26
26
  config_param :tag, :string
27
27
  desc 'Polling interval to get message from FESTIVAL EaaS API'
28
- config_param :polling_interval, :integer, :default => 60
28
+ config_param :polling_interval, :integer, default: 60
29
29
 
30
30
  # <resoruce> tag can be used for specifying multiple resources in a <source> tag
31
31
  # If the user wants to specify different format or polling interval for each resource,
@@ -67,20 +67,14 @@ module Fluent::Plugin
67
67
  #raise StandardError.new if @tag.nil?
68
68
  super
69
69
  start_proxy
70
- @proxy_thread = Thread.new(&method(:get_loop))
71
- end
72
-
73
- def get_loop
74
- while (true)
70
+ timer_execute(:in_festival, @polling_interval) do
75
71
  begin
76
72
  data = get_data
77
73
  emit(data) if !(data.nil? || data.empty?)
78
- sleep @polling_interval
79
74
  rescue Exception => e
80
- log.error :error => e.to_s
75
+ log.error error: e.to_s
81
76
  log.debug(e.backtrace.join("\n"))
82
- #log.debug_backtrace(e.backtrace)
83
- sleep @polling_interval
77
+ log.trace_backtrace(e.backtrace)
84
78
  end
85
79
  end
86
80
  end
@@ -103,13 +97,12 @@ module Fluent::Plugin
103
97
  router.emit(@tag, time, record)
104
98
  end
105
99
  rescue Exception => e
106
- log.error :error => e.to_s
100
+ log.error error: e.to_s
107
101
  log.debug_backtrace(e.backtrace)
108
102
  end
109
103
  end
110
104
 
111
105
  def shutdown
112
- @proxy_thread.kill
113
106
  shutdown_proxy
114
107
  super
115
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-festival
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toyokazu Akiyama