From 15291298aa8ce2b4b1911bd8747f1d95bf8474ea Mon Sep 17 00:00:00 2001 From: rays Date: Fri, 9 Oct 2026 01:41:15 +0000 Subject: [PATCH] Queue up to 1024 commands, so Download latest 100 does not hang (#154) The worker's queue held 64 commands, and a web request that queues work waits inside itself for a free place. Download latest lets you ask for up to 100 and sends one command a file, so past 64 the request waited for the worker to finish whole downloads, one after another, an hour for 100; Cloudflare gave up on it after 100 s and the page said it failed, though most were queued. Until it finished, adding a feed, Refresh, Download and socket commands all waited for a place too. A command is a few bytes; the queue now has room for any one request's. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + src/main.rs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f0dc18..91a3932 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Downloading the latest 65 to 100 items of a feed queues them at once, instead of hanging until most had downloaded and holding up adding feeds and Refresh meanwhile. - Changes to the feed list made at the same moment, such as two people adding feeds, or a feed added while the server settings change, no longer undo one another. - A download that stops partway is given up after two minutes without data, instead of holding up every scan and download until a restart. - On a phone, the closed feed list no longer shades the left edge of the page with its shadow. diff --git a/src/main.rs b/src/main.rs index e67d0f8..14cd66e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -594,7 +594,10 @@ async fn daemon( Err(e) => tracing::warn!(error = %format!("{e:#}"), "could not retire feeds whose OPML is no longer in config"), } - let (tx_cmd, mut rx_cmd) = mpsc::channel::(64); + // Room for any one request's commands: a web request waits inside itself for a free place, + // and Download latest sends up to 100. With 64 the rest waited on downloads an hour long, and + // every other request that queues work waited behind them (#154). + let (tx_cmd, mut rx_cmd) = mpsc::channel::(1024); let web = start_web(&ctx, &config_path, web_addr, &tx_cmd, &events).await?; // status and reload are answered by the socket itself; everything else waits its turn in the