Skip to content

Commit

Permalink
Use with when opening a file for upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kgodlewski committed Dec 17, 2024
1 parent f56a033 commit bf2b4fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/neptune_scale/sync/files/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ def _do_upload(
try:
url = self._request_upload_url(path)
src = local_path.open("rb") if local_path else io.BytesIO(data) # type: ignore
upload_file(src, url, mime_type)
with src:
upload_file(src, url, mime_type)

request_id = self._submit_attribute(attribute_path, path, timestamp)
self._wait_for_completion(request_id)
Expand Down

0 comments on commit bf2b4fd

Please sign in to comment.