fc-evaulator: allow fail-fast behaviour
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I1da41766f1c499347279c41f2316f4376a6a6964
This commit is contained in:
parent
49638d5d14
commit
235c9834b7
5 changed files with 30 additions and 134 deletions
|
|
@ -35,6 +35,7 @@ async fn main() -> anyhow::Result<()> {
|
|||
let workers = cli.workers.unwrap_or(qr_config.workers);
|
||||
let poll_interval = Duration::from_secs(qr_config.poll_interval);
|
||||
let build_timeout = Duration::from_secs(qr_config.build_timeout);
|
||||
let strict_errors = qr_config.strict_errors;
|
||||
let work_dir = qr_config.work_dir;
|
||||
|
||||
// Ensure the work directory exists
|
||||
|
|
@ -76,7 +77,7 @@ async fn main() -> anyhow::Result<()> {
|
|||
);
|
||||
|
||||
tokio::select! {
|
||||
result = fc_queue_runner::runner_loop::run(db.pool().clone(), worker_pool, poll_interval, wakeup) => {
|
||||
result = fc_queue_runner::runner_loop::run(db.pool().clone(), worker_pool, poll_interval, wakeup, strict_errors) => {
|
||||
if let Err(e) = result {
|
||||
tracing::error!("Runner loop failed: {e}");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ pub async fn run(
|
|||
worker_pool: Arc<WorkerPool>,
|
||||
poll_interval: Duration,
|
||||
wakeup: Arc<Notify>,
|
||||
strict_errors: bool,
|
||||
) -> anyhow::Result<()> {
|
||||
// Reset orphaned builds from previous crashes (older than 5 minutes)
|
||||
match repo::builds::reset_orphaned(&pool, 300).await {
|
||||
|
|
@ -184,6 +185,9 @@ pub async fn run(
|
|||
}
|
||||
},
|
||||
Err(e) => {
|
||||
if strict_errors {
|
||||
return Err(anyhow::anyhow!("Failed to fetch pending builds: {e}"));
|
||||
}
|
||||
tracing::error!("Failed to fetch pending builds: {e}");
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue