Skip to content

Commit

Permalink
now that unreplied messages cause rejected promises we need to preven…
Browse files Browse the repository at this point in the history
…t those from happening
  • Loading branch information
TShapinsky committed Dec 12, 2023
1 parent 4b63b09 commit d993358
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alfalfa_web/server/api-v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down

0 comments on commit d993358

Please sign in to comment.