Skip to content

Commit

Permalink
fix: Index update check
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmahidalgo committed Oct 12, 2022
1 parent 3c5efaa commit 95fbceb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ports/rentals/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,12 +502,13 @@ export async function createRentalsComponent(
}

// Identify if there's any blockchain nonce update

const hasUpdatedIndex =
indexerIndexesUpdate.contract[0]?.newIndex > rentalData.nonces[0] ||
indexerIndexesUpdate.signer[0]?.newIndex > rentalData.nonces[1] ||
indexerIndexesUpdate.asset[0]?.newIndex > rentalData.nonces[2]
Number(indexerIndexesUpdate.contract[0]?.newIndex) > Number(rentalData.nonces[0]) ||
Number(indexerIndexesUpdate.signer[0]?.newIndex) > Number(rentalData.nonces[1]) ||
Number(indexerIndexesUpdate.asset[0]?.newIndex) > Number(rentalData.nonces[2])

if (indexerRentals.length > 0 && hasUpdatedIndex) {
if (hasUpdatedIndex) {
logger.info(`[Refresh][Update rental][${rentalId}]`)
promisesOfUpdate.push(
database.query(
Expand Down

0 comments on commit 95fbceb

Please sign in to comment.