Skip to content

Commit

Permalink
fix: guard sync drift between cardano-db-sync and cardano-graphql
Browse files Browse the repository at this point in the history
This was not a fatal error as it's wrapped in the retry block, but does handle the case
with a description.
  • Loading branch information
rhyslbw committed Aug 27, 2021
1 parent bd8d01b commit 3c9707b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/api-cardano-db-hasura/src/HasuraClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ export class HasuraClient {
throw new Error(result.errors)
}
if (result.assets.length !== 0) {
if (result.assets[0].firstAppearedInBlock === null) {
throw new Error('cardano-db-sync is lagging behind the asset sync operation.')
}
const { hash, slotNo } = result.assets[0].firstAppearedInBlock
point = {
hash: hash.substring(2),
Expand Down

0 comments on commit 3c9707b

Please sign in to comment.