From 85c56df2e71b215a2904adcf614d88c4d37607ba Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Mon, 27 Jan 2025 13:44:39 -0500 Subject: [PATCH] Add worker max threads --- coreplugins/objdetect/api.py | 2 +- requirements.txt | 2 +- webodm/settings.py | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/coreplugins/objdetect/api.py b/coreplugins/objdetect/api.py index 5bc6f1c5..b3161948 100644 --- a/coreplugins/objdetect/api.py +++ b/coreplugins/objdetect/api.py @@ -17,7 +17,7 @@ def detect(orthophoto, model, progress_callback=None): return {'error': "GeoDeep library is missing"} try: - return {'output': gdetect(orthophoto, model, output_type='geojson', progress_callback=progress_callback)} + return {'output': gdetect(orthophoto, model, output_type='geojson', max_threads=settings.WORKERS_MAX_THREADS, progress_callback=progress_callback)} except Exception as e: return {'error': str(e)} diff --git a/requirements.txt b/requirements.txt index 5dbf8bc3..d3db17e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ drf-nested-routers==0.11.1 funcsigs==1.0.2 futures==3.1.1 gunicorn==19.8.0 -geodeep==0.9.4 +geodeep==0.9.7 itypes==1.1.0 kombu==4.6.7 Markdown==3.3.4 diff --git a/webodm/settings.py b/webodm/settings.py index 112b9d52..50cfcea4 100644 --- a/webodm/settings.py +++ b/webodm/settings.py @@ -384,6 +384,9 @@ UI_MAX_PROCESSING_NODES = None # are removed (or None to disable) CLEANUP_PARTIAL_TASKS = 72 +# Maximum number of threads that a worker should use for processing +WORKERS_MAX_THREADS = 1 + # Link to GCP docs GCP_DOCS_LINK = "https://docs.opendronemap.org/gcp/#gcp-file-format"