Skip to content

Commit

Permalink
Merge pull request #1593 from pierotofy/maxt
Browse files Browse the repository at this point in the history
Add worker max threads
  • Loading branch information
pierotofy authored Jan 27, 2025
2 parents d0139fc + 85c56df commit ffc134a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion coreplugins/objdetect/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions webodm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@
# 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"

Expand Down

0 comments on commit ffc134a

Please sign in to comment.