fix(relations): ignore canceled context noise
This commit is contained in:
@@ -194,6 +194,9 @@ func (h *Handler) HandleAPIAnime(w http.ResponseWriter, r *http.Request) {
|
||||
case "relations":
|
||||
relations, err := h.svc.GetRelations(r.Context(), id)
|
||||
if err != nil {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return
|
||||
}
|
||||
log.Printf("relations error for %d: %v", id, err)
|
||||
writeInlineLoadError(w, "Failed to load relations.")
|
||||
return
|
||||
|
||||
@@ -114,6 +114,9 @@ func (c *Client) GetFullRelations(ctx context.Context, id int) ([]RelationEntry,
|
||||
|
||||
anime, err := c.GetAnimeByID(ctx, watchOrderEntry.ID)
|
||||
if err != nil {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
continue
|
||||
}
|
||||
c.EnqueueAnimeFetchRetry(ctx, watchOrderEntry.ID, err)
|
||||
log.Printf("relations: skipping related anime %d for root %d: %v", watchOrderEntry.ID, id, err)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user