Skip to content

Commit 6dce770

Browse files
Stop providing finished experiments in queue
1 parent b2c5d9a commit 6dce770

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/experiments.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,18 @@ impl Experiment {
463463
if let Some(record) = db.get_row(query, rusqlite::params_from_iter(params.iter()), |r| {
464464
ExperimentDBRecord::from_row(r)
465465
})? {
466-
Ok(Some(record.into_experiment()?))
466+
let ex = record.into_experiment()?;
467+
let (completed, all) = ex.raw_progress(db)?;
468+
// FIXME: in this case, ideally we'd start running the next
469+
// experiment. In practice, this only happens with artifically short
470+
// experiments (i.e., those that take less time to run than we take
471+
// to generate a report), which is pretty rare. So this fix is
472+
// enough to make sure we're not constantly feeding a finished
473+
// experiment to our agents.
474+
if completed >= all {
475+
return Ok(None);
476+
}
477+
Ok(Some(ex))
467478
} else {
468479
Ok(None)
469480
}

0 commit comments

Comments
 (0)