gitea ae1bd67772
CI / compile (pull_request) Successful in 12s
CI / unit (pull_request) Successful in 29s
CI / integration (pull_request) Successful in 31s
build / build (push) Successful in 33s
CI / compile (push) Successful in 15s
CI / unit (push) Successful in 30s
CI / integration (push) Successful in 34s
Librarian: survive transient Crossref failures instead of losing the search
Field report: one httpx ReadTimeout inside habanero surfaced as
'Search <uuid> crashed', and the worker's crash handler then FORGOT the
request - so an expensive search vanished and the user was told it was
eaten, because a public API blinked once.

Two defences:
* Every habanero call goes through _crossref_call, which retries with
  linear backoff (CONJURER_CROSSREF_ATTEMPTS, default 4; backoff
  CONJURER_CROSSREF_BACKOFF, 5s). habanero wraps httpx errors in a plain
  RuntimeError so we can't filter narrowly - retries are simply bounded
  and the last error is re-raised. They now also run via asyncio.to_thread,
  so a slow Crossref no longer blocks the worker's event loop.
* A crashed search is no longer dropped on the first failure: the attempt
  count is persisted with the request and the search is requeued (keeping
  any checkpoint, so a crashed DB scan resumes rather than restarts) until
  CONJURER_SEARCH_MAX_ATTEMPTS (default 3). It stays 'queued' for the
  bot's watchdog while retrying, and only after the cap is it forgotten.

Also: scrape_bot's 'Got blocked' is routine sci-hub behaviour (it backs off
an hour and carries on) - log it as WARNING, not ERROR, so it stops looking
like a fault when scanning for real problems.

Tests: retry-then-succeed, bounded re-raise, no retry on success, the
persisted attempt counter, and forget-on-give-up. Suite: 58 unit + 70
integration green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-04 13:50:47 +02:00
2026-07-21 22:50:57 +02:00
2024-06-19 17:46:38 +02:00
2024-04-10 14:22:00 +02:00
2025-08-20 21:21:15 +02:00
2025-04-09 18:21:37 +01:00
2024-04-28 12:27:29 +02:00
2024-11-14 00:14:49 +01:00
2026-08-03 18:49:59 +02:00
2023-06-05 21:31:57 +02:00
2025-04-19 17:15:11 +02:00
2024-11-11 15:38:32 +01:00
2025-04-19 17:15:11 +02:00
2026-07-31 14:12:42 +02:00
2024-06-19 16:26:48 +01:00
2024-11-10 23:01:00 +00:00
2024-11-11 20:12:47 +00:00
2024-11-14 00:14:49 +01:00
2024-11-14 00:14:49 +01:00

conjurer

Discord.py bot for fun, sex and BDSM Additional line to trigger build.

S
Description
No description provided
Readme Unlicense 23 MiB
Languages
Python 99.6%
Shell 0.3%