fluent-plugin-proxysql-query-log 0.2.2 → 0.3.2

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: bb6e42614c4dd70c390287edf9d9d1c2eb11f91433d44e4bd8c490090b7624c7
4
- data.tar.gz: dc03e404fc9054f5b0beb60b548b99dace1f2a5e0a0f0acc31fb7c569f13dc29
3
+ metadata.gz: 9b84c786d14583dd24907fbd0f82b7661f368fc97171334ad409e6879ff940a3
4
+ data.tar.gz: 1a9010ef23e192ddd357fa75f4f84719743dfabe604cae41fc7234557ebbdcd1
5
5
  SHA512:
6
- metadata.gz: 8b99a422052d32d18d47e74f5ea5177cf0043d9c8bc7279620784554734e2bedcce14f384bbbae00e020f3d9c46aaeee2d580d4b91693ad173f9b4b7946301a5
7
- data.tar.gz: fa25452e020e843c4272746153e4ca262c5b3dea67423055f01e1cac6551bf5118b9114be0567d053756386ac0c0068cf62c2d97da66243d08b71bdd060ddddf
6
+ metadata.gz: 7657722bcef41d00c82d23948f0f32692237951bd90d2d3f2761bda11cc457f9f986096c374a5efae61d052b4660a39cfc7b124089eb8eff960e2f509ceed576
7
+ data.tar.gz: 1ba0f00265888db417955e4ceb5d45af2fbb08ce9d2e11589b00964ceaf7e290a086dfb35701d121d544f4eb752b0e6a0a903551ea26c183456ab906d679bf9f
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-proxysql-query-log (0.2.2)
4
+ fluent-plugin-proxysql-query-log (0.3.2)
5
5
  cool.io
6
6
  fluentd (>= 0.14.2, < 2)
7
7
  proxysql_query_log-parser
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-proxysql-query-log"
6
- spec.version = "0.2.2"
6
+ spec.version = "0.3.2"
7
7
  spec.authors = ["r_takaishi"]
8
8
  spec.email = ["ryo.takaishi.0@gmail.com"]
9
9
 
@@ -63,7 +63,7 @@ module Fluent
63
63
 
64
64
  def refresh_watchers
65
65
  target_paths = expand_paths
66
- stop_watchers(target_paths)
66
+ remove_detached_watcher
67
67
  start_watchers(target_paths)
68
68
  end
69
69
 
@@ -78,11 +78,8 @@ module Fluent
78
78
  end
79
79
  end
80
80
 
81
- def stop_watchers(paths)
82
- paths.each do |path|
83
- w = @watchers.delete(path) if w
84
- w.detach if w
85
- end
81
+ def remove_detached_watcher
82
+ @watchers = @watchers.select { |k, v| v.attached? }
86
83
  end
87
84
 
88
85
  private
@@ -20,10 +20,12 @@ module Fluent
20
20
  end
21
21
 
22
22
  def on_change(previous, current)
23
- @log.debug ("change: #{@path}")
24
- @log.debug ("previous: #{previous}")
25
- @log.debug ("current: #{current}")
26
- read
23
+ if current.nlink == 0
24
+ @log.debug("stop watch: #{@path} (deleted)")
25
+ detach
26
+ else
27
+ read
28
+ end
27
29
  end
28
30
 
29
31
  def read
@@ -71,6 +73,7 @@ module Fluent
71
73
  end
72
74
 
73
75
  def detach
76
+ @pos_storage.delete(@path)
74
77
  @attached = false
75
78
  super
76
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-proxysql-query-log
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - r_takaishi