lib/fluent/plugin/out_mysql_bulk.rb in fluent-plugin-mysql-bulk-0.0.2 vs lib/fluent/plugin/out_mysql_bulk.rb in fluent-plugin-mysql-bulk-0.0.3
- old
+ new
@@ -49,11 +49,10 @@
@format_proc = Proc.new{|tag, time, record| @key_names.map{|k| record[k]}}
end
def start
- @handler = client
super
end
def shutdown
super
@@ -73,9 +72,10 @@
:flags => Mysql2::Client::MULTI_STATEMENTS
})
end
def write(chunk)
+ @handler = client
values_templates = []
values = Array.new
chunk.msgpack_each { |tag, time, data|
values_templates.push "(#{@column_names.map{|key| '?'}.join(',')})"
values.concat(data)