@@ -112,7 +112,7 @@ class LogStash::Outputs::S3 < LogStash::Outputs::Base
112112 # If you define file_size you have a number of files in consideration of the section and the current tag.
113113 # 0 stay all time on listerner, beware if you specific 0 and size_file 0, because you will not put the file on bucket,
114114 # 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
116116
117117 ## IMPORTANT: if you use multiple instance of s3, you should specify on one of them the "restore=> true" and on the others "restore => false".
118118 ## 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
136136 config :prefix , :validate => :string , :default => ''
137137
138138 # 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
140140
141141 # 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
143143
144144 # The version of the S3 signature hash to use. Normally uses the internal client default, can be explicitly
145145 # specified here
@@ -349,7 +349,7 @@ def restore_from_crash
349349 Dir . glob ( ::File . join ( @temporary_directory , "**/*" ) ) do |file |
350350 if ::File . file? ( file )
351351 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 ) )
353353
354354 @logger . debug ( "Recovering from crash and uploading" , :file => temp_file . path )
355355 @crash_uploader . upload_async ( temp_file , :on_complete => method ( :clean_temporary_file ) )
0 commit comments