From 282ab4bce6b4047ead12ee1fca6fa4eeffd2ba10 Mon Sep 17 00:00:00 2001 From: KodeStar Date: Sat, 14 Nov 2026 18:29:48 +0000 Subject: [PATCH 1/2] Sync bot: a live libex lookup gets 5 seconds, then Audible's catalogue libex answers a live fetch it cannot make only after about 30 seconds, so the sync bot now waits 5 seconds for a live book record, series listing or chapter list, holds that lookup kind for 5 minutes, and asks Audible's catalogue for records and listings. Pairs with KodeStar/audiosilo-meta-sync fix/libex-live-timeout. --- docs-developers/meta/sync-bot.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs-developers/meta/sync-bot.md b/docs-developers/meta/sync-bot.md index 8dd4f64d..2d1853ee 100644 --- a/docs-developers/meta/sync-bot.md +++ b/docs-developers/meta/sync-bot.md @@ -23,7 +23,8 @@ It serves no public traffic. It talks only to: - libexdb.com; - api.github.com; - Audible's public catalog API (`api.audible.*`), only when libex says it cannot - reach Audible or libex's store search does not answer, and not at all with + reach Audible, a live libex lookup does not answer within 5 seconds, or + libex's store search does not answer, and not at all with `SYNC_AUDIBLE_FALLBACK=off`; - metaserve's intake queue, with [the reported-ASIN lane](#the-reported-asin-lane) enabled; @@ -299,6 +300,24 @@ or, when a memo entry keeps the copy out, once that entry expires. A copy outside the follow-up's window, of a book in a catalogued series, still arrives through its own marketplace's new-release or coming-soon feed. +### When libex's live lookups do not answer + +libex keeps a mirror (`/db/...`) and fetches what the mirror lacks from Audible +while the request waits. When libex cannot reach Audible, that live fetch +answers only after about 30 seconds, with a 503. So the service waits 5 seconds +for a live book record, series listing or chapter list, and treats no answer +as libex saying it cannot reach Audible: + +- it does not ask again, and holds that kind of lookup for 5 minutes; +- with `SYNC_AUDIBLE_FALLBACK` on, a book record or series listing goes to + Audible's own catalogue at once, and so does every one asked during the hold; +- a chapter list has no Audible fallback, so the book is written without + chapters. + +When Audible cannot answer either, the series stays queued for a later cycle +and spends none of its attempts. The mirror, the feeds and the store searches +keep their own timeouts. + ### When libex's search does not answer libex's live search can stop answering for every store at once, as it did on @@ -1058,7 +1077,7 @@ config surface is exactly this table. Only `GITHUB_TOKEN` is required. | `SYNC_REGIONS` | all 11 | `us uk ca au de fr es it jp in br`, exactly the meta schema's region enum. | | `SYNC_DRY_RUN` | off | Do everything except push and open a pull request. Leaves the diff in the clone and prints the pull request body. | | `LIBEX_BASE` | `https://libexdb.com` | For tests and local fakes. | -| `SYNC_AUDIBLE_FALLBACK` | on | Ask Audible's public catalog API for a book record or series listing that libex says it cannot give right now, and for a region search libex does not answer. `off` keeps the service to libex alone. | +| `SYNC_AUDIBLE_FALLBACK` | on | Ask Audible's public catalog API for a book record or series listing that libex says it cannot give right now or does not give within 5 seconds, and for a region search libex does not answer. `off` keeps the service to libex alone. | | `SYNC_AUDIBLE_SEARCH_BUDGET` | `1200` | Region searches a cycle may ask Audible's catalogue [when libex's search does not answer](#when-libexs-search-does-not-answer), apart from the 300 record and series requests. `0` asks none, which turns the search fallback off. Only with `SYNC_AUDIBLE_FALLBACK` on. | | `SYNC_TOOLS_DIR` | `/app/bin` | Where `metaimport`, `metafmt` and `metacheck` live. Empty means resolve on `PATH`. | | `SYNC_INTAKE_URL` | - | metaserve's address, for [the reported-ASIN lane](#the-reported-asin-lane). The lane runs only with this and the token both set. https, or plain http to a loopback host only. | From ec2183c7c1882b65f4879f78f3458c5bfaf2d663 Mon Sep 17 00:00:00 2001 From: KodeStar Date: Sat, 14 Nov 2026 19:12:51 +0000 Subject: [PATCH 2/2] Say a live chapter list waits up to 40 seconds Chapters have no Audible fallback, so the sync bot now gives a live chapter list up to 40 seconds (past libex's own wait on Audible) instead of 5, so a slow answer from a working libex is not lost. Book records and series listings keep 5 seconds. --- docs-developers/meta/sync-bot.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs-developers/meta/sync-bot.md b/docs-developers/meta/sync-bot.md index 2d1853ee..0ae16ada 100644 --- a/docs-developers/meta/sync-bot.md +++ b/docs-developers/meta/sync-bot.md @@ -305,14 +305,15 @@ through its own marketplace's new-release or coming-soon feed. libex keeps a mirror (`/db/...`) and fetches what the mirror lacks from Audible while the request waits. When libex cannot reach Audible, that live fetch answers only after about 30 seconds, with a 503. So the service waits 5 seconds -for a live book record, series listing or chapter list, and treats no answer -as libex saying it cannot reach Audible: +for a live book record or series listing, and up to 40 seconds for a chapter +list, and treats no answer as libex saying it cannot reach Audible: - it does not ask again, and holds that kind of lookup for 5 minutes; - with `SYNC_AUDIBLE_FALLBACK` on, a book record or series listing goes to Audible's own catalogue at once, and so does every one asked during the hold; -- a chapter list has no Audible fallback, so the book is written without - chapters. +- a chapter list has no Audible fallback, so it gets the longer wait: a slow + answer from a working libex still arrives. When none comes, the book is + written without chapters. When Audible cannot answer either, the series stays queued for a later cycle and spends none of its attempts. The mirror, the feeds and the store searches