fix: abort reading_status_match job on AniList 429 rate limit

Continuing after a 429 is pointless — all subsequent requests will also
fail. The job now returns Err immediately, which sets status='failed' with
a clear message indicating where it stopped.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 09:06:34 +01:00
parent 5f7f96f25a
commit 31538fac24

View File

@@ -369,6 +369,11 @@ pub(crate) async fn process_reading_status_match(
insert_result(pool, job_id, library_id, series_name, "ambiguous", None, None, None, None).await; insert_result(pool, job_id, library_id, series_name, "ambiguous", None, None, None, None).await;
} }
Err(e) => { Err(e) => {
if e.contains("429") || e.contains("Too Many Requests") {
return Err(format!(
"AniList rate limit exceeded (429) — job stopped after {processed}/{total} series"
));
}
warn!("[READING_STATUS_MATCH] series '{series_name}': {e}"); warn!("[READING_STATUS_MATCH] series '{series_name}': {e}");
insert_result(pool, job_id, library_id, series_name, "error", None, None, None, Some(&e)).await; insert_result(pool, job_id, library_id, series_name, "error", None, None, None, Some(&e)).await;
} }