fc-common: add failed paths cache infrastructure

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I35f9bfb044160151cf73c43ed9ada3476a6a6964
This commit is contained in:
raf 2026-02-16 23:05:52 +03:00
commit 65a6fd853d
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
5 changed files with 105 additions and 9 deletions

View file

@ -79,6 +79,14 @@ pub struct QueueRunnerConfig {
/// retrying.
#[serde(default)]
pub strict_errors: bool,
/// Cache failed derivation paths to skip known-failing builds.
#[serde(default = "default_true")]
pub failed_paths_cache: bool,
/// TTL in seconds for failed paths cache entries (default 24h).
#[serde(default = "default_failed_paths_ttl")]
pub failed_paths_ttl: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@ -405,6 +413,10 @@ const fn default_true() -> bool {
true
}
const fn default_failed_paths_ttl() -> u64 {
86400
}
const fn default_check_interval() -> i32 {
60
}
@ -521,11 +533,13 @@ impl Default for EvaluatorConfig {
impl Default for QueueRunnerConfig {
fn default() -> Self {
Self {
workers: 4,
poll_interval: 5,
build_timeout: 3600,
work_dir: PathBuf::from("/tmp/fc-queue-runner"),
strict_errors: false,
workers: 4,
poll_interval: 5,
build_timeout: 3600,
work_dir: PathBuf::from("/tmp/fc-queue-runner"),
strict_errors: false,
failed_paths_cache: true,
failed_paths_ttl: 86400,
}
}
}