message: indexer-agent/src/agent: Implement simple loop to wrap polling/resolving
diff: @@ -3,6 +3,17 @@ import { logging } from '@graphprotocol/common-ts'
  import { AgentConfig, SubgraphKey } from './types'
  import { Indexer } from './indexer'
  +let delay = async (ms: number) => {
  + await new Promise((resolve) => setTimeout(resolve, ms))
  +}
  +
  +let loop = async (f: () => Promise<void>, interval: number) => {
  + while (true) {
  + await f()
  + await delay(interval)
  + }
  +}
  +
  export class Agent {
  indexer: Indexer
  logger: logging.Logger
  @@ -13,8 +24,8 @@ export class Agent {
  }
  async start() {
  + await loop(async () => {
  let indexerSubgraphs = await this.indexer.subgraphs()
  -
  // Currently the network subgraphs list acts as a set of desired subgraph deployments
  // TODO: Fetch list of subgraphs from the Network subgraphs and use the supplied list of account and subgraph names
  // to resolve to a "desired" list
  @@ -24,7 +35,9 @@ export class Agent {
  contentHash: 'QmXsVSmFN7b5vNNia2JPbeE7NLkVHPPgZS2cHsvfH6myuV',
  },
  ]
  +
  await this.resolve(networkSubgraphs, indexerSubgraphs)
  + }, 5000)
  }
  async resolve(
  