Skip to content

Commit

Permalink
fix(sat-etl): Remove incorrect no products warning (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
devsjc authored Dec 24, 2024
1 parent bc1bce5 commit 3cb9b7a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions containers/sat/download_process_sat.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,16 @@ def download_scans(
try:
datastore = eumdac.DataStore(token)
collection = datastore.get_collection(sat_config.product_id)
products = collection.search(
search_results = collection.search(
dtstart=window_start.to_pydatetime(),
dtend=window_end.to_pydatetime(),
)
except Exception as e:
log.error(f"Error finding products: {e}")
return []

if len(products) == 0:
log.warning(f"No products found for {scan_time}.")

for product in products:
products_count: int = 0
for product in search_results:
for entry in list(filter(lambda p: p.endswith(".nat"), product.entries)):
filepath: pathlib.Path = folder / entry
# Prevent downloading existing files
Expand All @@ -225,6 +223,10 @@ def download_scans(
f"Error downloading product '{product}' (attempt {attempts}): '{e}'",
)
attempts += 1
products_count += 1

if products_count == 0:
log.warning(f"No products found for {scan_time}")

return files

Expand Down

0 comments on commit 3cb9b7a

Please sign in to comment.