Skip to content

Commit 6519235

Browse files
author
Nitin Goel
committed
Fixing the issue with deletion of temp file along with the dynamic prefix changes
1 parent 7b2bd8a commit 6519235

File tree

1 file changed

+6
-1
lines changed
  • lib/logstash/outputs

1 file changed

+6
-1
lines changed

lib/logstash/outputs/s3.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,13 @@ def reset_page_counter(key)
473473
private
474474
def delete_on_bucket(filename)
475475
bucket = @s3.buckets[@bucket]
476+
477+
first = Pathname.new @temporary_directory
478+
second = Pathname.new filename
476479

477-
remote_filename = "#{@prefix}#{File.basename(filename)}"
480+
remote_filename_path = second.relative_path_from first
481+
482+
remote_filename = remote_filename_path.to_s
478483

479484
@logger.debug("S3: delete file from bucket", :remote_filename => remote_filename, :bucket => @bucket)
480485

0 commit comments

Comments
 (0)