Skip to content

Commit

Permalink
Troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
openvmp committed Oct 30, 2024
1 parent b38b83a commit d32ec06
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions partcad/src/partcad/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions partcad/src/partcad/sync_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -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-")


Expand Down

0 comments on commit d32ec06

Please sign in to comment.