@@ -112,7 +112,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
112
112
# If you define file_size you have a number of files in consideration of the section and the current tag.
113
113
# 0 stay all time on listerner, beware if you specific 0 and size_file 0, because you will not put the file on bucket,
114
114
# for now the only thing this plugin can do is to put the file when logstash restart.
115
- config :time_file , :validate => :number , :default => 15 * 60
115
+ config :time_file , :validate => :number , :default => 15
116
116
117
117
## IMPORTANT: if you use multiple instance of s3, you should specify on one of them the "restore=> true" and on the others "restore => false".
118
118
## This is hack for not destroy the new files after restoring the initial files.
@@ -136,10 +136,10 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
136
136
config :prefix , :validate => :string , :default => ''
137
137
138
138
# Specify how many workers to use to upload the files to S3
139
- config :upload_workers_count , :validate => :number , :default => ( Concurrent . processor_count * 0.5 ) . round
139
+ config :upload_workers_count , :validate => :number , :default => ( Concurrent . processor_count * 0.5 ) . ceil
140
140
141
141
# Number of items we can keep in the local queue before uploading them
142
- config :upload_queue_size , :validate => :number , :default => 2 * ( Concurrent . processor_count * 0.25 ) . round
142
+ config :upload_queue_size , :validate => :number , :default => 2 * ( Concurrent . processor_count * 0.25 ) . ceil
143
143
144
144
# The version of the S3 signature hash to use. Normally uses the internal client default, can be explicitly
145
145
# specified here
@@ -349,7 +349,7 @@ def restore_from_crash
349
349
Dir . glob ( ::File . join ( @temporary_directory , "**/*" ) ) do |file |
350
350
if ::File . file? ( file )
351
351
key_parts = Pathname . new ( file ) . relative_path_from ( temp_folder_path ) . to_s . split ( ::File ::SEPARATOR )
352
- temp_file = TemporaryFile . new ( key_parts . slice ( 1 , key_parts . size ) . join ( "/" ) , ::File . open ( file , "r" ) )
352
+ temp_file = TemporaryFile . new ( key_parts . slice ( 1 , key_parts . size ) . join ( "/" ) , ::File . open ( file , "r" ) , key_parts . slice ( 0 , 1 ) )
353
353
354
354
@logger . debug ( "Recovering from crash and uploading" , :file => temp_file . path )
355
355
@crash_uploader . upload_async ( temp_file , :on_complete => method ( :clean_temporary_file ) )
0 commit comments