Skip to content

Commit

Permalink
Lock .tar.gz
Browse files Browse the repository at this point in the history
  • Loading branch information
iory committed Dec 10, 2024
1 parent d258445 commit bf55f2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ros/kxr_models/python/kxr_models/urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import shutil
import xml.etree.ElementTree as ET

from filelock import FileLock

from kxr_models.compress import make_tarfile
from kxr_models.md5sum_utils import checksum_md5
from kxr_models.path import resolve_filepath
Expand Down Expand Up @@ -55,7 +57,9 @@ def aggregate_urdf_mesh_files(input_urdf_path, output_directory, compress=False)
output_urdf_path = output_dir / "{}.urdf".format(root.get("name"))
tree.write(output_urdf_path)
if compress:
return make_tarfile(output_dir)
lock_path = f"{output_dir}.tar.gz.lock"
with FileLock(lock_path, timeout=10):
return make_tarfile(output_dir)
return output_urdf_path


Expand Down

0 comments on commit bf55f2d

Please sign in to comment.