FIX: S3Inventory to ignore files older than last backup restore date (#27166)

This commit updates `S3Inventory#files` to ignore S3 inventory files
which have a `last_modified` timestamp which are not at least 2 days
older than `BackupMetadata.last_restore_date` timestamp.

This check was previously only in `Jobs::EnsureS3UploadsExistence` but
`S3Inventory` can also be used via Rake tasks so this protection needs
to be in `S3Inventory` and not in the scheduled job.
This commit is contained in:
Alan Guo Xiang Tan
2024-05-24 10:54:06 +08:00
committed by GitHub
parent a4c5f85b10
commit df16ab0758
5 changed files with 77 additions and 72 deletions

View File

@ -27,6 +27,7 @@ class S3Helper
def initialize(s3_bucket_name, tombstone_prefix = "", options = {})
@s3_client = options.delete(:client)
@s3_bucket = options.delete(:bucket)
@s3_options = default_s3_options.merge(options)
@s3_bucket_name, @s3_bucket_folder_path =