From b52312776501d29f17308dfa8ecb037f6c6a716e Mon Sep 17 00:00:00 2001 From: Everaldo Date: Wed, 16 Oct 2024 12:08:17 -0700 Subject: [PATCH] Add logs. --- src/hub/dataload/sources/civic/civic_dump.py | 5 +++-- src/hub/dataload/sources/civic/graphql_dump.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hub/dataload/sources/civic/civic_dump.py b/src/hub/dataload/sources/civic/civic_dump.py index 8c3d3706..4bc97ca1 100644 --- a/src/hub/dataload/sources/civic/civic_dump.py +++ b/src/hub/dataload/sources/civic/civic_dump.py @@ -15,8 +15,8 @@ class CivicDumper(HTTPDumper): API_URL = "https://civicdb.org/api/graphql" SRC_ROOT_FOLDER = os.path.join(DATA_ARCHIVE_ROOT, SRC_NAME) SCHEDULE = "0 22 1 * *" - MAX_PARALLEL_DUMP = 2 - SLEEP_BETWEEN_DOWNLOAD = 1.0 + MAX_PARALLEL_DUMP = 1 + SLEEP_BETWEEN_DOWNLOAD = 3.0 def set_release(self): self.release = datetime.date.today().strftime("%Y-%m-%d") @@ -52,6 +52,7 @@ def download(self, remoteurl, localfile, headers={}): self.prepare_local_folders(localfile) variant_id = remoteurl + self.logger.info(f"Downloading data for variant id: {variant_id}") variant_data = GraphqlDump().dump_variant(variant_id=variant_id, api_url=self.API_URL) with open(localfile, "w") as f: diff --git a/src/hub/dataload/sources/civic/graphql_dump.py b/src/hub/dataload/sources/civic/graphql_dump.py index ba1e6653..bbfe1f5c 100644 --- a/src/hub/dataload/sources/civic/graphql_dump.py +++ b/src/hub/dataload/sources/civic/graphql_dump.py @@ -20,6 +20,7 @@ def get_variants_list(self, api_url: str): hasNextPage = response_data["data"]["browseVariants"]["pageInfo"][ "hasNextPage" ] + print(f"INFO:dump_civic:Count variant IDs = {len(ids)}") return ids def dump_variant(self, api_url: str, variant_id: int):