ngclient: Advisory locking for artifacts

This should prevent issues with multiple processes trying to write at
same time.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This commit is contained in:
Jussi Kukkonen 2025-08-22 18:48:55 +03:00
parent 6d666968df
commit 7a8edd9830

View file

@ -337,6 +337,7 @@ def download_target(
target_file.seek(0)
with open(filepath, "wb") as destination_file:
_lock_file(destination_file)
shutil.copyfileobj(target_file, destination_file)
logger.debug("Downloaded target %s", targetinfo.path)