From d32ec068cffc80b111d4173c9d973c04ec27a146 Mon Sep 17 00:00:00 2001 From: Roman Kuzmenko Date: Wed, 30 Oct 2024 12:17:18 -0700 Subject: [PATCH] Troubleshooting --- .github/workflows/python-test.yml | 4 ++-- partcad/src/partcad/shape.py | 6 +++--- partcad/src/partcad/sync_threads.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 0d2ff911..244e692b 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -50,7 +50,7 @@ jobs: if: runner.os == 'Windows' run: | curl -o openscad-installer.exe https://files.openscad.org/OpenSCAD-2021.01-x86-64-Installer.exe - openscad-installer.exe + ./openscad-installer.exe - name: Test with pytest env: PYTHONPATH: partcad/src @@ -103,7 +103,7 @@ jobs: if: runner.os == 'Windows' run: | curl -o openscad-installer.exe https://files.openscad.org/OpenSCAD-2021.01-x86-64-Installer.exe - openscad-installer.exe + ./openscad-installer.exe - name: Test the entire repository run: | pip install -U ./partcad ./partcad-cli diff --git a/partcad/src/partcad/shape.py b/partcad/src/partcad/shape.py index 990c6328..44748190 100644 --- a/partcad/src/partcad/shape.py +++ b/partcad/src/partcad/shape.py @@ -44,7 +44,7 @@ class Shape(ShapeConfiguration): def __init__(self, config): super().__init__(config) self.errors = [] - self.lock = threading.Lock() + self._lock = threading.Lock() self.shape = None self.components = [] self.compound = None @@ -61,11 +61,11 @@ def __init__(self, config): @contextlib.asynccontextmanager async def locked(self): """Multi-threading lock for coroutines""" - await pc_thread.run(self.lock.acquire) + await pc_thread.run(self._lock.acquire) try: yield finally: - self.lock.release() + self._lock.release() async def get_components(self): if len(self.components) == 0: diff --git a/partcad/src/partcad/sync_threads.py b/partcad/src/partcad/sync_threads.py index 51ea3b5e..22d3ba87 100644 --- a/partcad/src/partcad/sync_threads.py +++ b/partcad/src/partcad/sync_threads.py @@ -15,8 +15,8 @@ # Leave one core for the asyncio event loop and stuff if cpu_count > 1: cpu_count -= 1 -if cpu_count < 7: - cpu_count = 7 +if cpu_count < 5: + cpu_count = 5 executor = ThreadPoolExecutor(cpu_count, "partcad-executor-")