Skip to content

Commit ed6b22f

Browse files
committed
feat: rm duplicated abort logic
1 parent 978187c commit ed6b22f

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

server/src/routes/storage.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -949,26 +949,6 @@ router.post('/runs/abort/:id', requireSignIn, async (req: AuthenticatedRequest,
949949
});
950950
}
951951

952-
if (!['running', 'queued'].includes(run.status)) {
953-
return res.status(400).send({
954-
error: `Cannot abort run with status: ${run.status}`
955-
});
956-
}
957-
958-
await run.update({
959-
status: 'aborting'
960-
});
961-
962-
if (run.status === 'queued') {
963-
await run.update({
964-
status: 'aborted',
965-
finishedAt: new Date().toLocaleString(),
966-
log: 'Run aborted while queued'
967-
});
968-
969-
return res.send({ success: true, message: 'Queued run aborted' });
970-
}
971-
972952
const userQueueName = `abort-run-user-${req.user.id}`;
973953
await pgBoss.createQueue(userQueueName);
974954

0 commit comments

Comments
 (0)