Worker: separate quick lane for summaries and answers
CI / test (push) Successful in 1m8s
CI / build (push) Successful in 4m9s
CI / deploy (push) Skipped

Summaries and questions get their own slots (QUICK_CONCURRENCY, default 2),
so they never wait behind detailed analyses (ANALYSIS_CONCURRENCY, default
4). A free slow slot also takes quick work; a lane of size 0 is off, so the
lanes can run as separate deployments. Documented that several workers can
share the queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-19 06:40:09 +00:00
co-authored by Claude Opus 5.5
parent d46cd7a445
commit bc0227042b
5 changed files with 150 additions and 53 deletions
+4 -1
View File
@@ -24,8 +24,10 @@ pub struct Config {
pub openrouter_base_url: String,
/// Frontend address, sent to OpenRouter as `HTTP-Referer`.
pub public_base_url: Option<String>,
/// Analyses written at the same time.
/// Detailed analyses and forecasts written at the same time (0: none).
pub analysis_concurrency: usize,
/// Summaries and answers written at the same time (0: none).
pub quick_concurrency: usize,
/// After this many failed attempts an analysis fails and is refunded.
pub max_analysis_attempts: i32,
}
@@ -67,6 +69,7 @@ impl Config {
.unwrap_or_else(|| crate::analysis::openrouter::DEFAULT_BASE_URL.into()),
public_base_url: var("PUBLIC_BASE_URL"),
analysis_concurrency: parsed("ANALYSIS_CONCURRENCY", 4)?,
quick_concurrency: parsed("QUICK_CONCURRENCY", 2)?,
max_analysis_attempts: parsed("MAX_ANALYSIS_ATTEMPTS", 3)?,
})
}