lib/fluent/plugin/out_tdlog.rb in fluent-plugin-td-0.10.1 vs lib/fluent/plugin/out_tdlog.rb in fluent-plugin-td-0.10.2

- old
+ new

@@ -14,10 +14,11 @@ HOST = host PORT = port USE_SSL = false BASE_URL = '' + IMPORT_SIZE_LIMIT = 32*1024*1024 def initialize require 'fileutils' require 'tempfile' require 'zlib' @@ -38,9 +39,18 @@ @flush_interval = 300 # overwrite default flush_interval to 5mins end def configure(conf) super + + # force overwrite buffer_chunk_limit + if @buffer.respond_to?(:buffer_chunk_limit=) && @buffer.respond_to?(:buffer_queue_limit=) + if @buffer.buffer_chunk_limit > IMPORT_SIZE_LIMIT + ex = @buffer.buffer_chunk_limit / IMPORT_SIZE_LIMIT + @buffer.buffer_chunk_limit = IMPORT_SIZE_LIMIT + @buffer.buffer_queue_limit *= ex if ex > 0 + end + end @tmpdir = conf['tmpdir'] || @tmpdir FileUtils.mkdir_p(@tmpdir) @apikey = conf['apikey']