Skip to content

Commit

Permalink
common: Automatically pause subgraph deployments after unallocating
Browse files Browse the repository at this point in the history
- When confirming an unallocate action has succeeded, upsert an
indexing rule for that deployment with decisionBasis=Never.
  • Loading branch information
fordN committed Jul 11, 2024
1 parent 5c788c8 commit d453475
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/indexer-common/src/indexer-management/allocations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,14 +645,14 @@ export class AllocationManager {
logger.debug(
`Updating indexing rules so indexer-agent keeps the deployment synced but doesn't reallocate to it`,
)
const offchainIndexingRule = {
const neverIndexingRule = {
identifier: allocation.subgraphDeployment.id.ipfsHash,
protocolNetwork: this.network.specification.networkIdentifier,
identifierType: SubgraphIdentifierType.DEPLOYMENT,
decisionBasis: IndexingDecisionBasis.OFFCHAIN,
decisionBasis: IndexingDecisionBasis.NEVER,
} as Partial<IndexingRuleAttributes>

await upsertIndexingRule(logger, this.models, offchainIndexingRule)
await upsertIndexingRule(logger, this.models, neverIndexingRule)

return {
actionID,
Expand Down

0 comments on commit d453475

Please sign in to comment.