fix(lint): log S110 bare except-pass in amazon client and worker
Three ruff S110 violations replaced with logger.debug calls: - amazon_client.py:527 duration backfill ASIN search - amazon_client.py:679 album metadata fetch in _fetch_album_metas - amazon_worker.py:401 artist image backfill from albums
This commit is contained in:
parent
42a833fcb2
commit
35db1ac06d
2 changed files with 6 additions and 6 deletions
|
|
@ -524,8 +524,8 @@ class AmazonClient:
|
||||||
for item in search_items:
|
for item in search_items:
|
||||||
if item.album_asin == asin and item.duration_seconds:
|
if item.album_asin == asin and item.duration_seconds:
|
||||||
duration_map[item.asin] = item.duration_seconds * 1000
|
duration_map[item.asin] = item.duration_seconds * 1000
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
logger.debug("Duration backfill failed for ASIN %s: %s", asin, exc)
|
||||||
|
|
||||||
items = [
|
items = [
|
||||||
{
|
{
|
||||||
|
|
@ -676,8 +676,8 @@ class AmazonClient:
|
||||||
with _meta_cache_lock:
|
with _meta_cache_lock:
|
||||||
_meta_cache[asin] = (time.monotonic(), meta)
|
_meta_cache[asin] = (time.monotonic(), meta)
|
||||||
metas[asin] = meta
|
metas[asin] = meta
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
logger.debug("Album metadata fetch failed for ASIN %s: %s", asin, exc)
|
||||||
|
|
||||||
from concurrent.futures import ThreadPoolExecutor
|
from concurrent.futures import ThreadPoolExecutor
|
||||||
with ThreadPoolExecutor(max_workers=min(len(asins), 5)) as pool:
|
with ThreadPoolExecutor(max_workers=min(len(asins), 5)) as pool:
|
||||||
|
|
|
||||||
|
|
@ -398,8 +398,8 @@ class AmazonWorker:
|
||||||
if not image_url:
|
if not image_url:
|
||||||
try:
|
try:
|
||||||
image_url = self.client._get_artist_image_from_albums(result.id)
|
image_url = self.client._get_artist_image_from_albums(result.id)
|
||||||
except Exception:
|
except Exception as exc:
|
||||||
pass
|
logger.debug("Artist image from albums failed for %s: %s", result.id, exc)
|
||||||
if image_url:
|
if image_url:
|
||||||
cursor.execute("""
|
cursor.execute("""
|
||||||
UPDATE artists SET thumb_url = ?
|
UPDATE artists SET thumb_url = ?
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue