Skip to content

Commit

Permalink
mv log into conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
zzmp committed Jan 22, 2024
1 parent 4603694 commit b90a959
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions lib/handlers/check-order-status/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,24 +313,25 @@ export class CheckOrderStatusHandler extends SfnLambdaHandler<ContainerInjected,
validation,
} = params

log.info(
{
orderHash,
quoteId,
retryCount,
startingBlockNumber,
chainId,
lastStatus,
orderStatus,
txHash,
settledAmounts,
getFillLogAttempts,
},
'updating order status'
)
// Avoid updating the order if the status is unchanged.
// This also avoids unnecessarily triggering downstream events from dynamodb changes.
if (orderStatus !== lastStatus) {
log.info(
{
orderHash,
quoteId,
retryCount,
startingBlockNumber,
chainId,
lastStatus,
orderStatus,
txHash,
settledAmounts,
getFillLogAttempts,
},
'updating order status'
)

await dbInterface.updateOrderStatus(orderHash, orderStatus, txHash, settledAmounts)

if (IS_TERMINAL_STATE(orderStatus)) {
Expand Down

0 comments on commit b90a959

Please sign in to comment.