Skip to content

Commit

Permalink
Merge pull request #230 from Aiven-Open/dmitry-potepalov-clickhouse-r…
Browse files Browse the repository at this point in the history
…eset-temp-file

seek the temp file when copying between storages
  • Loading branch information
aris-aiven committed Aug 27, 2024
2 parents 4c7d045 + df0a6d9 commit 8b2b964
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions astacus/coordinator/plugins/clickhouse/object_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ def _copy_via_local_filesystem(
for keys_copied, key in enumerate(keys):
with tempfile.TemporaryFile(dir=copy_config.temporary_directory) as temp_file:
metadata = source.get_contents_to_fileobj(key, temp_file)
temp_file.seek(0)
target.store_file_object(key, temp_file, metadata)
if stats:
stats.gauge(
Expand Down

0 comments on commit 8b2b964

Please sign in to comment.