Skip to content

Commit

Permalink
fix(sync_db): ensure rows returned from tile cache query is iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
gtempus committed Jan 22, 2024
1 parent d143171 commit 8071e29
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions app/crud/sync_db/tile_cache_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ def get_all_tile_caches():
WHERE assets.asset_type IN {str(tuple([e.value for e in list(TileCacheType)])).replace('"', "'")}
AND assets.status = 'saved'"""
).fetchall()
if rows is None:
# tile_caches = []
logger.warning("Rows is None. There are no tile caches registered with the API")
elif len(rows) == 0:
logger.warning("Zero rows. There are no tile caches registered with the API")
else:
logger.warning(f"Found {len(rows)} rows")
# tile_caches = rows

if rows is None or len(rows) == 0:
logger.warning(
"No rows returned. There are no tile caches registered with the API"
)
rows = []

for row in rows:
tile_caches[row.asset_type].append(
Expand Down

0 comments on commit 8071e29

Please sign in to comment.