Skip to content

Commit 7c119c3

Browse files
committed
in_forward: Seek more opprtunity to optimize
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent 3c7dadf commit 7c119c3

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

lib/fluent/plugin/in_forward.rb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ def each(unpacker: nil, &block)
6868
helpers :server
6969

7070
LISTEN_PORT = 24224
71+
OPTION_FLUENT_SIGNAL = 'fluent_signal'.freeze
7172

7273
desc 'The port to listen to.'
7374
config_param :port, :integer, default: LISTEN_PORT
@@ -354,13 +355,11 @@ def on_message(msg, chunk_size, conn)
354355
else
355356
es = Fluent::MessagePackEventStream.new(entries, nil, size.to_i)
356357
end
357-
es = if @skip_invalid_event
358-
normalize_event_stream(tag, es, conn.remote_host)
359-
elsif option['fluent_signal'] == 0
360-
MetadataTimeEventStream.new(es)
361-
else
362-
es
363-
end
358+
if @skip_invalid_event
359+
es = normalize_event_stream(tag, es, conn.remote_host)
360+
elsif option[OPTION_FLUENT_SIGNAL] == 0
361+
es = MetadataTimeEventStream.new(es)
362+
end
364363
if @enable_field_injection
365364
es = add_source_info(es, conn)
366365
end

0 commit comments

Comments
 (0)