diff --git a/alfalfa_web/server/api-v2.js b/alfalfa_web/server/api-v2.js index ff1078fe..8fd04643 100644 --- a/alfalfa_web/server/api-v2.js +++ b/alfalfa_web/server/api-v2.js @@ -776,6 +776,10 @@ router.post("/runs/:runId/advance", (req, res, next) => { * $ref: '#/components/schemas/Error' */ router.post("/runs/:runId/stop", (req, res, next) => { + // If the run is already stopping or stopped there is no need to send message + if (["STOPPING", "STOPPED", "COMPLETE"].includes(req.run.status)) { + res.sendStatus(204); + } api .stopRun(req.run) .then(() => {