Debug logging on LB rolling-mirror bulk ensure
Temporary instrumentation — bulk ensure path silently created only one rolling mirror despite multiple known series members existing in the LB cache. Promotes the bulk-ensure summary + per-title match notes to INFO level so the next refresh surfaces in the server log: - ``[LB Rolling] Bulk ensure walking N cached titles for profile X`` - ``[LB Rolling] Title matched series: <title> -> <series_id>`` - ``[LB Rolling] Bulk ensure done — M/N titles matched a series`` Plus the outer ``except`` is bumped from debug to warning so a genuine SELECT failure stops being invisible. Once the root cause is identified the noise can drop back to debug.
This commit is contained in:
parent
4dc70b3611
commit
5378b726ee
1 changed files with 15 additions and 1 deletions
|
|
@ -245,10 +245,24 @@ class ListenBrainzManager:
|
|||
(self.profile_id,),
|
||||
)
|
||||
titles = [row[0] for row in cursor.fetchall() if row[0]]
|
||||
logger.info(
|
||||
f"[LB Rolling] Bulk ensure walking {len(titles)} cached titles for profile {self.profile_id}"
|
||||
)
|
||||
from core.playlists.lb_series import detect_series
|
||||
matched = 0
|
||||
for title in titles:
|
||||
m = detect_series(title)
|
||||
if m is not None:
|
||||
matched += 1
|
||||
logger.info(
|
||||
f"[LB Rolling] Title matched series: {title!r} -> {m.series_id}"
|
||||
)
|
||||
self._ensure_rolling_series_mirror(cursor, title)
|
||||
logger.info(
|
||||
f"[LB Rolling] Bulk ensure done — {matched}/{len(titles)} titles matched a series"
|
||||
)
|
||||
except Exception as exc:
|
||||
logger.debug(f"Bulk rolling-mirror ensure skipped: {exc}")
|
||||
logger.warning(f"Bulk rolling-mirror ensure skipped: {exc}")
|
||||
|
||||
def _ensure_rolling_series_mirror(self, cursor, playlist_title: str):
|
||||
"""Upsert a placeholder ``mirrored_playlists`` row for the
|
||||
|
|
|
|||
Loading…
Reference in a new issue