Add message links, suspect retries, and Discord preview recovery

This commit is contained in:
Fisto
2026-09-18 11:47:08 +02:00
parent 9481286169
commit 8752b36209
16 changed files with 831 additions and 35 deletions
+19
View File
@@ -210,6 +210,25 @@ a cached still show a labeled placeholder, and playback streams only when the us
GIF hover plays the animated GIF cached in `thumbs/` (the original is kept alongside the static
frame and referenced by `anim_hash`), never the provider, so scrolling cannot spam anyone.
## Failure policy and recovery
The archive never treats a transient HTTP answer as a dead link on the first try.
- A preview or download that fails with an HTTP status on Discord's CDN is retried once with a
**refreshed URL** from the source message (the signed link expires in about a day). Only if the
refreshed fetch fails is the row parked.
- Parked rows become **suspects**: they get one delayed retry (about 50 s). The retry runs after
the batch, not immediately. If a batch is two-thirds suspect failures, the cooldown doubles
(floor 60 s) and the retries run before the next batch.
- A suspect whose delayed retry fails again is left **unverified**: it is skipped by later passes,
so a finished backfill never churns over genuinely unavailable media. The Bot tab shows suspects
and unverified counts per member, and the progress bar fills blue for cached, gray for pending,
and red for failed rows.
- **Recover Discord previews** is a one-shot task in the Bot tab: it walks every scrape's
Discord-CDN rows closed with HTTP errors, refreshes each URL through the message (slopbot REST or
the puppet, whichever the scrape used), and fetches the preview again. It starts paused; when it
finishes it moves to the task history. The code stays for reuse.
## Bot tab settings
The Bot tab owns the tunables; they persist in `preferences.json` and apply to live jobs at once.