Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule to set automatic renewal for allocations #366

Merged
merged 1 commit into from
Feb 23, 2022

Conversation

hopeyen
Copy link
Contributor

@hopeyen hopeyen commented Feb 18, 2022

In addition to the feature to configure allocationLifetime, we also add the feature autoRenewal to indicate to the indexer agent if it should re-allocate to a particular deployment when it expires.

All the existing rules are given the default true. If you want to stop indexing a subgraph once it expires, use indexer-cli to set autoRenewal to false.

@hopeyen hopeyen force-pushed the hope/allocation-auto-renewal branch 5 times, most recently from 91e9245 to 9bdd42e Compare February 23, 2022 00:54
number: expiredAllocations.length,
expiredAllocations: expiredAllocations.map(allocation => allocation.id),
})
if (rule?.autoRenewal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about merging this with the conditional that is one level up?

So it would be something like:
if (rule?.autoRenewal && expiredAllocation.length > 0) {...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I kept them separate was for the log info below. Do you think the message is useful? If not, I can merge them :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, ok. Let's leave it in.

Yeah, I think it's useful. It allows an indexer to see why their allocations aren't being reallocated to.

packages/indexer-agent/src/agent.ts Outdated Show resolved Hide resolved
@hopeyen hopeyen force-pushed the hope/allocation-auto-renewal branch 2 times, most recently from f79a590 to df7db6a Compare February 23, 2022 01:21
Copy link
Contributor

@fordN fordN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@hopeyen hopeyen merged commit 20ba2ca into main Feb 23, 2022
@hopeyen hopeyen deleted the hope/allocation-auto-renewal branch February 23, 2022 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants