Skip to content

Commit

Permalink
test: time to cleanup data?
Browse files Browse the repository at this point in the history
  • Loading branch information
nickumia-reisys committed Jul 27, 2023
1 parent ad41b6e commit 87ac89d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ckanext/geodatagov/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import sys
import tempfile
import time
import warnings
from typing import Optional

Expand Down Expand Up @@ -201,6 +202,7 @@ def upload_to_key(upload_str: str, filename_on_s3: str) -> None:
log.error(f"File {filename_on_s3} upload failed. Error: {resp_metadata}")

del temp_file
time.sleep(30)


def upload_sitemap_file(sitemap: list) -> None:
Expand Down Expand Up @@ -229,7 +231,7 @@ def sitemap_to_s3(upload_to_s3: bool, page_size: int, max_per_page: int):
log.info("Nothing to process, exiting.")
return

start = 0
start = 140000

num_of_pages = (count // page_size) + 1

Expand All @@ -247,7 +249,7 @@ def sitemap_to_s3(upload_to_s3: bool, page_size: int, max_per_page: int):
{S3_ENDPOINT_URL}/{BUCKET_NAME}/{sitemap_index.filename_s3}"
)

for file_num in range(1, num_of_pages + 1):
for file_num in range(14, 38):
sitemap = SitemapData(str(file_num), start, page_size)
sitemap.write_sitemap_header()
sitemap.write_pkgs(package_query)
Expand All @@ -274,6 +276,7 @@ def sitemap_to_s3(upload_to_s3: bool, page_size: int, max_per_page: int):
print(json.dumps(sitemap.to_json(), indent=4))

del sitemap
time.sleep(30)


def _normalize_type(_type):
Expand Down

0 comments on commit 87ac89d

Please sign in to comment.