Skip to content

Commit

Permalink
fix to use NumericTimeParser to parse float time (without error of fl…
Browse files Browse the repository at this point in the history
…oating point value)
  • Loading branch information
tagomoris committed Nov 11, 2016
1 parent 100e599 commit 6a5490c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fluent/plugin/in_http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def start
event_loop_attach(@km)
event_loop_attach(@lsock)

@float_time_parser = Fluent::NumericTimeParser.new(:float)

# detach_multi_process do
# super
# @km = KeepaliveManager.new(@keepalive_timeout)
Expand Down Expand Up @@ -187,7 +189,7 @@ def on_request(path_info, params)
end
time = if param_time = params['time']
param_time = param_time.to_f
param_time.zero? ? Fluent::Engine.now : Fluent::EventTime.from_time(Time.at(param_time))
param_time.zero? ? Fluent::Engine.now : @float_time_parser.parse(param_time)
else
record_time.nil? ? Fluent::Engine.now : record_time
end
Expand Down

0 comments on commit 6a5490c

Please sign in to comment.