Skip to content

Commit

Permalink
indexer-agent: join indexingRules eventual with targetDeployments
Browse files Browse the repository at this point in the history
indexer-agent: shorten indexing ruels and join with targetDeployments

indexer-agent: join indexingRules eventual with targetDeployments
  • Loading branch information
hopeyen committed Jan 24, 2022
1 parent 52d9229 commit e608ef8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/indexer-agent/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export GRAPH_ALLOW_NON_DETERMINISTIC_FULLTEXT_SEARCH=true
10 changes: 7 additions & 3 deletions packages/indexer-agent/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,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 @@ -230,10 +230,14 @@ class Agent {
},
)

const targetDeployments = timer(120_000).tryMap(
// for targetAllocations, do it on branch hope/offchain_commands? either wait til merge or rebase
const targetDeployments = join({
ticker: timer(120_000),
indexingRules,
}).tryMap(
async () => {
const rules = await indexingRules.value()

// Identify subgraph deployments on the network that are worth picking up;
// these may overlap with the ones we're already indexing
return rules.length === 0
Expand Down

0 comments on commit e608ef8

Please # to comment.