From 13e191a7bbbb371fe4b5a3c78fb42ee9744c1b97 Mon Sep 17 00:00:00 2001
From: chausman <chausman@nrao.edu>
Date: Mon, 22 Aug 2022 08:38:58 -0600
Subject: [PATCH] make productfectcher use default threads capo property

---
 .../productfetcher/productfetcher/product_fetcher.py      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/apps/cli/executables/pexable/productfetcher/productfetcher/product_fetcher.py b/apps/cli/executables/pexable/productfetcher/productfetcher/product_fetcher.py
index 8ca6358b2..7e9e03cea 100644
--- a/apps/cli/executables/pexable/productfetcher/productfetcher/product_fetcher.py
+++ b/apps/cli/executables/pexable/productfetcher/productfetcher/product_fetcher.py
@@ -24,6 +24,8 @@ from pathlib import Path
 from typing import List, Type
 
 # pylint: disable=E0401, E0402, R0913
+from pycapo import CapoConfig
+
 from .exceptions import FetchError
 from .fetcher_factory import ConfiguredFetcherFactory
 from .fetchers import ForceMode
@@ -263,6 +265,8 @@ class FetchContext:
         :return: an argparse 'parser' with command line options for productfetcher.
         """
 
+        default_threads = CapoConfig().settings("edu.nrao.workspaces.ProductFetcherSettings").defaultThreadsPerHost
+
         parser = argparse.ArgumentParser(
             description=_PROLOGUE,
             formatter_class=argparse.RawTextHelpFormatter,
@@ -272,9 +276,9 @@ class FetchContext:
             CLIParam.CONCURRENCY.value,
             action="store",
             dest="concurrency",
-            help="maxmimum threads per plan (set to 1 for no threading)",
+            help="maximum threads per plan (set to 1 for no threading)",
             type=int,
-            default=16,
+            default=default_threads,
         )
 
         parser.add_argument(
-- 
GitLab