Skip to content

Commit 1598644

Browse files
committed
Only stop active jobs
1 parent 53ba204 commit 1598644

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

server/src/manager.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,13 @@ impl JobManager {
598598
}
599599

600600
pub async fn job_stop(&self, _authn: &Identity, job_id: &JobId) -> Result<(), JobError> {
601-
self.monitor(MonitorRequest::Stop(job_id.to_owned())).await
601+
if let Some(status) = self.active_jobs.lock().await.get(job_id)
602+
&& status.is_active()
603+
{
604+
self.monitor(MonitorRequest::Stop(job_id.to_owned()))
605+
.await?;
606+
}
607+
Ok(())
602608
}
603609

604610
pub async fn job_output(

0 commit comments

Comments
 (0)