Skip to content

Commit cac45a8

Browse files
committed
remove bottlnech with removing chunks
1 parent 58fca7c commit cac45a8

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

server/mergin/sync/public_api_controller.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,14 +1028,6 @@ def push_finish(transaction_id):
10281028
# let's move uploaded files where they are expected to be
10291029
os.renames(files_dir, version_dir)
10301030

1031-
# remove used chunks
1032-
for file in upload.changes["added"] + upload.changes["updated"]:
1033-
file_chunks = file.get("chunks", [])
1034-
for chunk_id in file_chunks:
1035-
chunk_file = os.path.join(upload.upload_dir, "chunks", chunk_id)
1036-
if os.path.exists(chunk_file):
1037-
move_to_tmp(chunk_file)
1038-
10391031
logging.info(
10401032
f"Push finished for project: {project.id}, project version: {v_next_version}, transaction id: {transaction_id}."
10411033
)

server/mergin/sync/public_api_v2_controller.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,6 @@ def create_project_version(id):
318318
temp_files_dir = os.path.join(upload.upload_dir, "files", v_next_version)
319319
os.renames(temp_files_dir, version_dir)
320320

321-
# remove used chunks
322-
for file in to_be_added_files + to_be_updated_files:
323-
file_chunks = file.get("chunks", [])
324-
for chunk_id in file_chunks:
325-
chunk_file = get_chunk_location(chunk_id)
326-
if os.path.exists(chunk_file):
327-
move_to_tmp(chunk_file)
328-
329321
logging.info(
330322
f"Push finished for project: {project.id}, project version: {v_next_version}, upload id: {upload.id}."
331323
)
@@ -377,7 +369,6 @@ def upload_chunk(id: str):
377369
# we could have used request.data here, but it could eventually cause OOM issue
378370
save_to_file(request.stream, dest_file, current_app.config["MAX_CHUNK_SIZE"])
379371
except IOError:
380-
move_to_tmp(dest_file, chunk_id)
381372
return BigChunkError().response(413)
382373
except Exception as e:
383374
return UploadError(error="Error saving chunk").response(400)

0 commit comments

Comments
 (0)