Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing file because of cutoff time change #224

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/logstash/inputs/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def run(queue)
def list_new_files
objects = []
found = false
current_time = Time.now
begin
@s3bucket.objects(:prefix => @prefix).each do |log|
found = true
Expand All @@ -140,7 +141,7 @@ def list_new_files
@logger.debug('Object Zero Length', :key => log.key)
elsif !sincedb.newer?(log.last_modified)
@logger.debug('Object Not Modified', :key => log.key)
elsif log.last_modified > (Time.now - CUTOFF_SECOND).utc # file modified within last two seconds will be processed in next cycle
elsif log.last_modified > (current_time - CUTOFF_SECOND).utc # file modified within last two seconds will be processed in next cycle
@logger.debug('Object Modified After Cutoff Time', :key => log.key)
elsif (log.storage_class == 'GLACIER' || log.storage_class == 'DEEP_ARCHIVE') && !file_restored?(log.object)
@logger.debug('Object Archived to Glacier', :key => log.key)
Expand Down