Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-Li committed Jan 2, 2024
1 parent 612b34d commit fdc2d8a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions indexer/services/vulcan/src/handlers/order-remove-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,21 @@ export class OrderRemoveHandler extends Handler {
* update since it occurred which would invalidate the message.
*/
protected async isOrderExpired(orderRemove: OrderRemoveV1): Promise<boolean> {
const block: BlockFromDatabase = await runFuncWithTimingStat(
BlockTable.getLatest({ readReplica: true }),
this.generateTimingStatsOptions('get_latest_block_for_indexer_expired_expiry_verification'),
);
let block: BlockFromDatabase;
try {
block = await runFuncWithTimingStat(
BlockTable.getLatest({ readReplica: true }),
this.generateTimingStatsOptions('get_latest_block_for_indexer_expired_expiry_verification'),
);
} catch {
logger.error({
at: 'orderRemoveHandler#isOrderExpired',
message: 'Unable to find latest block',
orderRemove,
});
// We can't say with certainty that this order is expired, so return false
return false;
}

const redisOrder: RedisOrder | null = await runFuncWithTimingStat(
OrdersCache.getOrder(OrderTable.orderIdToUuid(orderRemove.removedOrderId!), redisClient),
Expand Down

0 comments on commit fdc2d8a

Please sign in to comment.