Skip to content

Commit

Permalink
indexer-agent: quicker response to rules
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswessels authored and hopeyen committed Feb 2, 2022
1 parent fc0fa5a commit a943ec4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 7 additions & 3 deletions packages/indexer-agent/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class Agent {
},
)

const indexingRules = timer(60_000).tryMap(
const indexingRules = timer(20_000).tryMap(
async () => {
let rules = await this.indexer.indexingRules(true)
const subgraphRuleIds = rules
Expand Down Expand Up @@ -252,7 +252,10 @@ class Agent {
},
)

const targetAllocations = timer(120_000).tryMap(
const targetAllocations = join({
ticker: timer(120_000),
indexingRules,
}).tryMap(
async () => {
const rules = await indexingRules.value()

Expand All @@ -274,6 +277,7 @@ class Agent {
// and offchain subgraphs.
const targetDeployments = join({
ticker: timer(120_000),
indexingRules,
targetAllocations,
}).tryMap(
async target => {
Expand Down Expand Up @@ -616,7 +620,7 @@ class Agent {
}
}

// Ensure that all subgraphs in offchain subgraphs list are _always_ indexed
// Ensure all subgraphs in offchain subgraphs list are _always_ indexed
for (const offchainSubgraph of this.offchainSubgraphs) {
if (!deploymentInList(targetDeployments, offchainSubgraph)) {
targetDeployments.push(offchainSubgraph)
Expand Down
3 changes: 0 additions & 3 deletions packages/indexer-agent/src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,6 @@ export class Network {
id
}
}
subgraph {
id
}
}
}
`,
Expand Down

0 comments on commit a943ec4

Please # to comment.