Skip to content

Commit

Permalink
common: remove paused workaround (perf)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwerner committed Oct 7, 2024
1 parent 4c1fb8c commit 2199080
Showing 1 changed file with 3 additions and 32 deletions.
35 changes: 3 additions & 32 deletions packages/indexer-common/src/graph-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,47 +153,18 @@ export class GraphNode {
): Promise<SubgraphDeploymentAssignment[]> {
try {
this.logger.debug('Fetch subgraph deployment assignments')

// FIXME: remove this initial check for just node when graph-node releases
// https://github.com/graphprotocol/graph-node/pull/5551
const nodeOnlyResult = await this.status
const result = await this.status
.query(gql`
{
query indexingStatuses {
indexingStatuses {
subgraphDeployment: subgraph
node
paused
}
}
`)
.toPromise()

if (nodeOnlyResult.error) {
throw nodeOnlyResult.error
}

const withAssignments: string[] = nodeOnlyResult.data.indexingStatuses
.filter((result: QueryResult) => {
return result.node !== null && result.node !== undefined
})
.map((result: QueryResult) => {
return result.subgraphDeployment
})

const result = await this.status
.query(
gql`
query indexingStatuses($subgraphs: [String!]!) {
indexingStatuses(subgraphs: $subgraphs) {
subgraphDeployment: subgraph
node
paused
}
}
`,
{ subgraphs: withAssignments },
)
.toPromise()

if (result.error) {
throw result.error
}
Expand Down

0 comments on commit 2199080

Please sign in to comment.