mirror of
https://github.com/elastic/logstash.git
synced 2025-04-25 07:07:54 -04:00
fix jruby bigdecimal handling in Time.at
This commit is contained in:
parent
7783f76a4c
commit
5c063fa3fd
1 changed files with 7 additions and 1 deletions
|
@ -24,8 +24,14 @@ module LogStash
|
|||
end
|
||||
|
||||
def self.at(*args)
|
||||
epoch = args.first
|
||||
if epoch.is_a?(BigDecimal)
|
||||
# bug in JRuby prevents correcly parsing a BigDecimal fractional part, see https://github.com/elastic/logstash/issues/4565
|
||||
Timestamp.new(::Time.at(epoch.to_i, epoch.frac.to_f * 1000000))
|
||||
else
|
||||
Timestamp.new(::Time.at(*args))
|
||||
end
|
||||
end
|
||||
|
||||
def self.parse(*args)
|
||||
Timestamp.new(::Time.parse(*args))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue