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 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
### Fixed
|
### 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.
|
- 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.
|
- 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.
|
- On a phone, the closed feed list no longer shades the left edge of the page with its shadow.
|
||||||
|
|||||||
@@ -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"),
|
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::<Cmd>(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::<Cmd>(1024);
|
||||||
|
|
||||||
let web = start_web(&ctx, &config_path, web_addr, &tx_cmd, &events).await?;
|
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
|
// status and reload are answered by the socket itself; everything else waits its turn in the
|
||||||
|
|||||||
Reference in New Issue
Block a user