fix: log silent gaps in fetchRelationResults

This commit is contained in:
2026-06-16 00:19:38 +02:00
committed by Milas Holsting
parent 0bde5ac778
commit fda2346d9a

View File

@@ -237,6 +237,16 @@ func (c *Client) fetchRelationResults(ctx context.Context, entries []watchorder.
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return nil
}
observability.Warn(
"relations_fetch_entry_failed",
"jikan",
"",
map[string]any{
"anime_id": entry.ID,
"index": i,
},
err,
)
c.EnqueueAnimeFetchRetry(gCtx, entry.ID, err)
return nil
}
@@ -260,6 +270,20 @@ func (c *Client) fetchRelationResults(ctx context.Context, entries []watchorder.
fetched = append(fetched, res)
}
if len(fetched) < len(entries) {
observability.Warn(
"relations_fetch_incomplete",
"jikan",
"",
map[string]any{
"expected": len(entries),
"fetched": len(fetched),
"missing": len(entries) - len(fetched),
},
nil,
)
}
sort.Slice(fetched, func(i, j int) bool {
return fetched[i].index < fetched[j].index
})