exports: Limit s3 upload exports with path_id checks.

This commit is contained in:
Steve Howell
2021-12-07 12:18:05 +00:00
committed by Tim Abbott
parent f6cbf931ae
commit 0e19deb558

View File

@@ -1316,6 +1316,9 @@ def export_uploads_and_avatars(realm: Realm, output_dir: Path) -> None:
user_ids = {user.id for user in users}
# Some bigger installations will have their data stored on S3.
path_ids = {attachment.path_id for attachment in attachments}
export_files_from_s3(
realm,
flavor="upload",
@@ -1323,7 +1326,7 @@ def export_uploads_and_avatars(realm: Realm, output_dir: Path) -> None:
object_prefix=f"{realm.id}/",
output_dir=uploads_output_dir,
user_ids=user_ids,
valid_hashes=None,
valid_hashes=path_ids,
)
avatar_hash_values = set()