File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -463,7 +463,18 @@ impl Experiment {
463
463
if let Some ( record) = db. get_row ( query, rusqlite:: params_from_iter ( params. iter ( ) ) , |r| {
464
464
ExperimentDBRecord :: from_row ( r)
465
465
} ) ? {
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) )
467
478
} else {
468
479
Ok ( None )
469
480
}
You can’t perform that action at this time.
0 commit comments