Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: remove duplicate function invocation
Also improves logging within HasuraClient
  • Loading branch information
rhyslbw committed Jan 22, 2021
1 parent 238e41f commit 73d553b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/api-cardano-db-hasura/src/HasuraClient.ts
Expand Up @@ -33,6 +33,7 @@ export class HasuraClient {
pollingInterval: number,
private logger: Logger = dummyLogger
) {
this.applyingSchemaAndMetadata = false
this.adaCirculatingSupplyFetcher = new DataFetcher<AssetSupply['circulating']>(
'AdaCirculatingSupply',
this.getAdaCirculatingSupply.bind(this),
Expand All @@ -59,14 +60,15 @@ export class HasuraClient {
}

public async initialize () {
await this.applySchemaAndMetadata()
this.logger.info('Initializing Hasura', { module: 'HasuraClient' })
await pRetry(async () => {
this.schema = await this.buildHasuraSchema()
}, {
factor: 1.75,
retries: 9,
onFailedAttempt: util.onFailedAttemptFor('Fetching Hasura schema via introspection')
})
this.logger.info('Hasura initialized', { module: 'HasuraClient' })
await this.adaCirculatingSupplyFetcher.initialize()
}

Expand Down

0 comments on commit 73d553b

Please sign in to comment.