Skip to content

Commit 6799d03

Browse files
Nevins Bartolomeoph
authored andcommitted
simpler solutions for correcting seconds vs minutes
Fixes #102
1 parent dc7b3fd commit 6799d03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/logstash/outputs/s3/time_rotation_policy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ def initialize(time_file)
1010
raise LogStash::ConfigurationError, "`time_file` need to be greather than 0"
1111
end
1212

13-
@time_file = time_file
13+
@time_file = time_file * 60
1414
end
1515

1616
def rotate?(file)
17-
file.size > 0 && ((Time.now - file.ctime)/60).floor >= time_file
17+
file.size > 0 && (Time.now - file.ctime) >= time_file
1818
end
1919

2020
def need_periodic?

0 commit comments

Comments
 (0)