Skip to content

Commit

Permalink
fix failed orders not reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
jmicko committed May 11, 2024
1 parent 8112cd0 commit 6ea4db9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions server/modules/robot.js
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,9 @@ async function updateMultipleOrders(userID, params) {
if (updatedOrder.order.status === 'CANCELLED') {
devLog('was canceled but should not have been!')
updatedOrder.order.reorder = true;
} else if (updatedOrder.order.status === 'FAILED') {
devLog('original order failed! reordering')
updatedOrder.order.reorder = true;
}
// then update db with current status
await databaseClient.updateTrade(updatedOrder.order);
Expand Down
2 changes: 1 addition & 1 deletion server/routes/account.router.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ router.get('/errors', rejectUnauthenticated, async (req, res) => {
const userID = req.user.id;
try {
const userErrors = messenger[userID].getErrors();
console.log(userErrors, '< userErrors');
// console.log(userErrors, '< userErrors');
res.send(userErrors);
} catch (err) {
devLog(err, 'problem debug route');
Expand Down

0 comments on commit 6ea4db9

Please sign in to comment.