diff --git a/runner/src/indexer/indexer.test.ts b/runner/src/indexer/indexer.test.ts index ecd13151d..5f3d42b23 100644 --- a/runner/src/indexer/indexer.test.ts +++ b/runner/src/indexer/indexer.test.ts @@ -220,6 +220,7 @@ describe('Indexer unit tests', () => { getPgBouncerConnectionParameters: jest.fn().mockReturnValue(genericDbCredentials), fetchUserApiProvisioningStatus: jest.fn().mockResolvedValue(true), provisionLogsAndMetadataIfNeeded: jest.fn(), + ensureConsistentHasuraState: jest.fn(), } as unknown as Provisioner; const config = { @@ -930,6 +931,7 @@ describe('Indexer unit tests', () => { fetchUserApiProvisioningStatus: jest.fn().mockReturnValue(false), provisionUserApi: jest.fn(), provisionLogsAndMetadataIfNeeded: jest.fn(), + ensureConsistentHasuraState: jest.fn(), }; const indexerMeta = { writeLogs: jest.fn(), @@ -975,6 +977,7 @@ describe('Indexer unit tests', () => { fetchUserApiProvisioningStatus: jest.fn().mockReturnValue(true), provisionUserApi: jest.fn(), provisionLogsAndMetadataIfNeeded: jest.fn(), + ensureConsistentHasuraState: jest.fn(), }; const indexer = new Indexer(simpleSchemaConfig, { fetch: mockFetch as unknown as typeof fetch, @@ -1012,6 +1015,7 @@ describe('Indexer unit tests', () => { fetchUserApiProvisioningStatus: jest.fn().mockReturnValue(true), provisionUserApi: jest.fn(), provisionLogsAndMetadataIfNeeded: jest.fn(), + ensureConsistentHasuraState: jest.fn(), }; const indexerMeta = { writeLogs: jest.fn(), @@ -1060,6 +1064,7 @@ describe('Indexer unit tests', () => { fetchUserApiProvisioningStatus: jest.fn().mockReturnValue(true), provisionUserApi: jest.fn(), provisionLogsAndMetadataIfNeeded: jest.fn(), + ensureConsistentHasuraState: jest.fn(), }; const indexerMeta = { writeLogs: jest.fn(), @@ -1111,6 +1116,7 @@ describe('Indexer unit tests', () => { provisionUserApi: jest.fn().mockRejectedValue(error), provisionLogsIfNeeded: jest.fn(), provisionMetadataIfNeeded: jest.fn(), + ensureConsistentHasuraState: jest.fn(), }; const indexerMeta = { writeLogs: jest.fn(), diff --git a/runner/src/indexer/indexer.ts b/runner/src/indexer/indexer.ts index eb6ecf1e2..f1b601e7f 100644 --- a/runner/src/indexer/indexer.ts +++ b/runner/src/indexer/indexer.ts @@ -100,6 +100,7 @@ export default class Indexer { logEntries.push(provisionSuccessLogEntry); } await this.deps.provisioner.provisionLogsAndMetadataIfNeeded(this.indexerConfig); + await this.deps.provisioner.ensureConsistentHasuraState(this.indexerConfig); } catch (e) { const error = e as Error; simultaneousPromises.push(this.writeLogOld(LogLevel.ERROR, blockHeight, `Provisioning endpoint: failure:${error.message}`));