File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -500,7 +500,7 @@ impl Experiment {
500
500
}
501
501
}
502
502
503
- pub fn handle_failure ( & mut self , db : & Database , agent : & Assignee ) -> Fallible < ( ) > {
503
+ pub fn clear_agent_progress ( & mut self , db : & Database , agent : & str ) -> Fallible < ( ) > {
504
504
// Mark all the running crates from this agent as queued (so that they
505
505
// run again)
506
506
db. execute (
@@ -514,7 +514,7 @@ impl Experiment {
514
514
& Status :: Queued . to_string ( ) ,
515
515
& self . name ,
516
516
& Status :: Running . to_string ( ) ,
517
- & agent. to_string ( ) ,
517
+ & Assignee :: Agent ( agent. to_string ( ) ) . to_string ( ) ,
518
518
] ,
519
519
) ?;
520
520
Ok ( ( ) )
@@ -1096,7 +1096,7 @@ mod tests {
1096
1096
. get_uncompleted_crates( & db, & config, & agent1)
1097
1097
. unwrap( )
1098
1098
. is_empty( ) ) ;
1099
- ex. handle_failure ( & db, & agent1 ) . unwrap ( ) ;
1099
+ ex. clear_agent_progress ( & db, "agent-1" ) . unwrap ( ) ;
1100
1100
assert ! ( Experiment :: next( & db, & agent1) . unwrap( ) . is_some( ) ) ;
1101
1101
assert_eq ! ( ex. status, Status :: Running ) ;
1102
1102
assert ! ( !ex
Original file line number Diff line number Diff line change @@ -323,7 +323,7 @@ fn endpoint_error(
323
323
. ok_or_else ( || err_msg ( "no experiment run by this agent" ) ) ?;
324
324
325
325
data. metrics . record_error ( & auth. name , & ex. name ) ;
326
- ex. handle_failure ( & data. db , & Assignee :: Agent ( auth. name ) ) ?;
326
+ ex. clear_agent_progress ( & data. db , & auth. name ) ?;
327
327
328
328
Ok ( ApiResponse :: Success { result : true } . into_response ( ) ?)
329
329
}
You can’t perform that action at this time.
0 commit comments