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: issue with timestamp comparison #248

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions lib/logstash/inputs/s3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def list_new_files
@logger.debug('Ignoring', :key => log.key)
elsif log.content_length <= 0
@logger.debug('Object Zero Length', :key => log.key)
elsif log.last_modified <= sincedb_time
elsif log.last_modified.to_i <= sincedb_time.to_i
@logger.debug('Object Not Modified', :key => log.key)
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)
Expand Down Expand Up @@ -380,7 +380,7 @@ def process_log(queue, log)
filename = File.join(temporary_directory, File.basename(log.key))
if download_remote_file(object, filename)
if process_local_log(queue, filename, object)
if object.last_modified == log.last_modified
if object.last_modified.to_i == log.last_modified.to_i
backup_to_bucket(object)
backup_to_dir(filename)
delete_file_from_bucket(object)
Expand Down