fluent-plugin-pghstore 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "fluent-plugin-pghstore"
6
- s.version = "0.0.4"
6
+ s.version = "0.1.0"
7
7
  s.authors = ["WAKAYAMA Shirou"]
8
8
  s.email = ["shirou.faw@gmail.com"]
9
9
  s.homepage = "https://github.com/shirou/fluent-plugin-pghstore"
@@ -37,7 +37,11 @@ class Fluent::PgHStoreOutput < Fluent::BufferedOutput
37
37
  def write(chunk)
38
38
  chunk.msgpack_each {|(tag, time_str, record)|
39
39
  sql = generate_sql(tag, time_str, record)
40
- @conn.exec(sql)
40
+ begin
41
+ @conn.exec(sql)
42
+ rescue PGError => e
43
+ $log.error "PGError: " + e.message # throw away
44
+ end
41
45
  }
42
46
  end
43
47
 
@@ -54,7 +58,7 @@ class Fluent::PgHStoreOutput < Fluent::BufferedOutput
54
58
 
55
59
  sql =<<"SQL"
56
60
  INSERT INTO #{@table} (tag, time, record) VALUES
57
- (ARRAY[#{tag_list.join(",")}], '#{Time.at(time)}'::TIMESTAMP WITH TIME ZONE, '#{kv_list.join(",")}');
61
+ (ARRAY[#{tag_list.join(",")}], '#{Time.at(time)}'::TIMESTAMP WITH TIME ZONE, E'#{kv_list.join(",")}');
58
62
  SQL
59
63
 
60
64
  return sql
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-pghstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-06 00:00:00.000000000 Z
12
+ date: 2012-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec